From 5b77144d91159d313026bd41c8c72e03918a459a Mon Sep 17 00:00:00 2001 From: FoolHen Date: Sun, 31 May 2026 15:54:36 +0200 Subject: [PATCH] fix: fix pipedald port parameter --- src/PiPedalConfiguration.hpp | 10 +++++++++- src/main.cpp | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/PiPedalConfiguration.hpp b/src/PiPedalConfiguration.hpp index 779f7e8..a02131d 100644 --- a/src/PiPedalConfiguration.hpp +++ b/src/PiPedalConfiguration.hpp @@ -75,7 +75,15 @@ public: void SetSocketServerEndpoint(const std::string &endpoint) { - this->socketServerAddress_ = endpoint; + if (endpoint.find(':') == std::string::npos) + { + // Only a port number was provided, use default address. + this->socketServerAddress_ = "0.0.0.0:" + endpoint; + } + else + { + this->socketServerAddress_ = endpoint; + } } bool GetAccessPointGateway(boost::asio::ip::network_v4 *pGatewayNetwork) const { diff --git a/src/main.cpp b/src/main.cpp index 7f264cd..5b34c4e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) } if (parser.Arguments().size() == 0) { - throw PiPedalException(" not provided."); + throw PiPedalException(" not provided."); } if (help || parser.Arguments().size() == 0) { @@ -225,7 +225,7 @@ int main(int argc, char *argv[]) << "Options:\n" << " -systemd: Log to systemd journals instead of to the console.\n" << " -port: Port to listen on e.g. 80, or 0.0.0.0:80\n" - << " -log-level: (debug|info|warning|error)" + << " -log-level: (debug|info|warning|error)\n" << "Example:\n" << " pipedald /etc/pipedal/config /etc/pipedal/react -port 80 \n" "\n"