From 751cd79f787261ca06d9a3b87b244f8f13bc10ae Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Tue, 13 Oct 2026 11:06:43 +0200 Subject: [PATCH] libhsscomm: bound the init callbacks with a timeout HSSManager::XmlRpcCallSync() calls system.listMethods and listDevices on the receiver from PlatformInit(), inside the daemon's main loop, with an XmlRpcClient that has no timeout. A receiver that accepts the connection and never answers (a hung logic layer, a port forwarded to something that stalls) therefore freezes rfd or hs485d completely - no RPC for any other client, no events, no radio - until that connection closes. Give the client a 30 s timeout. A timed-out call takes the existing transport error path, so such a receiver costs at most two timeouts per init instead of the whole daemon. 30 s is three times the event dispatcher's bound and well beyond the answer time of a healthy receiver's listDevices, which a false timeout would skip until its next init. Fixes #170 --- src/libhsscomm/HSSManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libhsscomm/HSSManager.cpp b/src/libhsscomm/HSSManager.cpp index 24c54f0d..84ad3ccd 100644 --- a/src/libhsscomm/HSSManager.cpp +++ b/src/libhsscomm/HSSManager.cpp @@ -132,6 +132,7 @@ void HSSManager::ReportEvent(const std::string& address, const std::string& valu bool HSSManager::XmlRpcCallSync(const char* method, XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue* result, const std::string& url) { XmlRpcClient c(url); + c.setTimeout(30000); // this runs on the daemon's main loop: do not wait forever for a receiver that does not answer if(!c.execute(method, params, *result)){ LOG(Logger::LOG_ERROR, "XmlRpc transport error calling %s(%s) on %s:", method, params.toText().c_str(), c.getURL().c_str()); }else{