Hello community, here is the log from the commit of package soapy-remote for openSUSE:Factory checked in at 2018-06-19 12:02:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/soapy-remote (Old) and /work/SRC/openSUSE:Factory/.soapy-remote.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "soapy-remote" Tue Jun 19 12:02:28 2018 rev:2 rq:616943 version:0.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/soapy-remote/soapy-remote.changes 2017-11-08 15:09:32.887330678 +0100 +++ /work/SRC/openSUSE:Factory/.soapy-remote.new/soapy-remote.changes 2018-06-19 12:02:30.908590192 +0200 @@ -1,0 +2,14 @@ +Fri Jun 8 20:03:36 UTC 2018 - [email protected] + +- Update to version 0.4.3 + + Added missing remote:prot key to getStreamArgsInfo() + + Additional timeout for first connect due to ARP delay + + Disable LogAcceptor during discovery in Release mode + + SSDP should be quiet when periodic events are disabled + + Server listener checks socket status and exits on error + + Additional timeout for discovery and logger unpackers + + Improved error logger messages with associated url + + Parameterized connect timeout with remote:timeout arg + + Reverted accidental change to default timeout constant + +------------------------------------------------------------------- @@ -4 +18 @@ -- Update to version 0.4.1 +- Update to version 0.4.2 Old: ---- soapy-remote-0.4.2.tar.gz New: ---- soapy-remote-0.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ soapy-remote.spec ++++++ --- /var/tmp/diff_new_pack.BgESAX/_old 2018-06-19 12:02:31.588564944 +0200 +++ /var/tmp/diff_new_pack.BgESAX/_new 2018-06-19 12:02:31.592564796 +0200 @@ -1,6 +1,7 @@ # # spec file for package soapy-remote # +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -19,7 +20,7 @@ %define soapy_modname soapysdr%{soapy_modver}-module-remote Name: soapy-remote -Version: 0.4.2 +Version: 0.4.3 Release: 0 Summary: Use any Soapy SDR remotely License: BSL-1.0 ++++++ soapy-remote-0.4.2.tar.gz -> soapy-remote-0.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/Changelog.txt new/SoapyRemote-soapy-remote-0.4.3/Changelog.txt --- old/SoapyRemote-soapy-remote-0.4.2/Changelog.txt 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/Changelog.txt 2018-03-20 03:42:28.000000000 +0100 @@ -1,3 +1,16 @@ +Release 0.4.3 (2018-03-19) +========================== + +- Added missing remote:prot key to getStreamArgsInfo() +- Additional timeout for first connect due to ARP delay +- Disable LogAcceptor during discovery in Release mode +- SSDP should be quiet when periodic events are disabled +- Server listener checks socket status and exits on error +- Additional timeout for discovery and logger unpackers +- Improved error logger messages with associated url +- Parameterized connect timeout with remote:timeout arg +- Reverted accidental change to default timeout constant + Release 0.4.2 (2017-07-31) ========================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/client/LogAcceptor.cpp new/SoapyRemote-soapy-remote-0.4.3/client/LogAcceptor.cpp --- old/SoapyRemote-soapy-remote-0.4.2/client/LogAcceptor.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/client/LogAcceptor.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "LogAcceptor.hpp" @@ -19,6 +19,7 @@ struct LogAcceptorThreadData { LogAcceptorThreadData(void): + timeoutUs(SOAPY_REMOTE_SOCKET_TIMEOUT_US), done(true), thread(nullptr), useCount(0) @@ -39,6 +40,7 @@ SoapyRPCSocket client; std::string url; + long timeoutUs; sig_atomic_t done; std::thread *thread; sig_atomic_t useCount; @@ -49,10 +51,10 @@ client = SoapyRPCSocket(); //specify a timeout on connect because the link may be lost //when the thread attempts to re-establish a connection - int ret = client.connect(url, SOAPY_REMOTE_SOCKET_TIMEOUT_US); + int ret = client.connect(url, timeoutUs); if (ret != 0) { - SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::connect() FAIL: %s", client.lastErrorMsg()); + SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::connect(%s) FAIL: %s", url.c_str(), client.lastErrorMsg()); done = true; return; } @@ -63,13 +65,13 @@ SoapyRPCPacker packerStart(client); packerStart & SOAPY_REMOTE_START_LOG_FORWARDING; packerStart(); - SoapyRPCUnpacker unpackerStart(client); + SoapyRPCUnpacker unpackerStart(client, true, timeoutUs); done = false; thread = new std::thread(&LogAcceptorThreadData::handlerLoop, this); } catch (const std::exception &ex) { - SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::activate() FAIL: %s", ex.what()); + SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::activate(%s) FAIL: %s", url.c_str(), ex.what()); done = true; } } @@ -90,7 +92,7 @@ } catch (const std::exception &ex) { - SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::shutdown() FAIL: %s", ex.what()); + SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::shutdown(%s) FAIL: %s", url.c_str(), ex.what()); } //the thread will exit due to the requests above @@ -119,7 +121,7 @@ } catch (const std::exception &ex) { - SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::handlerLoop() FAIL: %s", ex.what()); + SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyLogAcceptor::handlerLoop(%s) FAIL: %s", url.c_str(), ex.what()); } done = true; @@ -155,12 +157,12 @@ /*********************************************************************** * client subscription hooks **********************************************************************/ -SoapyLogAcceptor::SoapyLogAcceptor(const std::string &url, SoapyRPCSocket &sock) +SoapyLogAcceptor::SoapyLogAcceptor(const std::string &url, SoapyRPCSocket &sock, const long timeoutUs) { SoapyRPCPacker packer(sock); packer & SOAPY_REMOTE_GET_SERVER_ID; packer(); - SoapyRPCUnpacker unpacker(sock); + SoapyRPCUnpacker unpacker(sock, true, timeoutUs); unpacker & _serverId; std::lock_guard<std::mutex> lock(logMutex); @@ -168,6 +170,7 @@ auto &data = handlers[_serverId]; data.useCount++; data.url = url; + if (timeoutUs != 0) data.timeoutUs = timeoutUs; threadMaintenance(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/client/LogAcceptor.hpp new/SoapyRemote-soapy-remote-0.4.3/client/LogAcceptor.hpp --- old/SoapyRemote-soapy-remote-0.4.2/client/LogAcceptor.hpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/client/LogAcceptor.hpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2015 Josh Blum +// Copyright (c) 2015-2017 Josh Blum // SPDX-License-Identifier: BSL-1.0 #pragma once @@ -13,7 +13,7 @@ class SoapyLogAcceptor { public: - SoapyLogAcceptor(const std::string &url, SoapyRPCSocket &sock); + SoapyLogAcceptor(const std::string &url, SoapyRPCSocket &sock, const long timeoutUs = 0); ~SoapyLogAcceptor(void); private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/client/Registration.cpp new/SoapyRemote-soapy-remote-0.4.3/client/Registration.cpp --- old/SoapyRemote-soapy-remote-0.4.2/client/Registration.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/client/Registration.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "SoapyClient.hpp" @@ -56,6 +56,11 @@ if (args.count(SOAPY_REMOTE_KWARG_STOP) != 0) return result; + //extract timeout + long timeoutUs = SOAPY_REMOTE_SOCKET_TIMEOUT_US; + const auto timeoutIt = args.find("remote:timeout"); + if (timeoutIt != args.end()) timeoutUs = std::stol(timeoutIt->second); + //no remote specified, use the discovery protocol if (args.count("remote") == 0) { @@ -71,7 +76,7 @@ ssdpEndpoint->enablePeriodicSearch(true); //wait maximum timeout for replies - std::this_thread::sleep_for(std::chrono::microseconds(SOAPY_REMOTE_SOCKET_TIMEOUT_US)); + std::this_thread::sleep_for(std::chrono::microseconds(timeoutUs)); //determine IP version preferences int ipVer(4); @@ -104,10 +109,16 @@ if (url.getScheme().empty()) url.setScheme("tcp"); if (url.getService().empty()) url.setService(SOAPY_REMOTE_DEFAULT_SERVICE); + //The first connection may be delayed by ARP, either on the client + //or the server side as previous communication was multi-casted. + //To be consistent with the normal specified timeout value, + //the first connection timeout is increased to compensate. + const long arpTimeout(SOAPY_REMOTE_SOCKET_TIMEOUT_US); + //try to connect to the remote server SoapySocketSession sess; SoapyRPCSocket s; - int ret = s.connect(url.toString(), SOAPY_REMOTE_SOCKET_TIMEOUT_US); + int ret = s.connect(url.toString(), timeoutUs+arpTimeout); if (ret != 0) { SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemote::find() -- connect(%s) FAIL: %s", url.toString().c_str(), s.lastErrorMsg()); @@ -117,7 +128,10 @@ //find transaction try { - SoapyLogAcceptor logAcceptor(url.toString(), s); + //No log forwarding during discovery unless debug build: + #ifndef NDEBUG + SoapyLogAcceptor logAcceptor(url.toString(), s, timeoutUs); + #endif //NDEBUG SoapyRPCPacker packer(s); packer & SOAPY_REMOTE_FIND; @@ -134,7 +148,7 @@ } catch (const std::exception &ex) { - SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemote::find() -- transact FAIL: %s", ex.what()); + SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemote::find(%s) -- transact FAIL: %s", url.toString().c_str(), ex.what()); } //remove instances of the stop key from the result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/client/Settings.cpp new/SoapyRemote-soapy-remote-0.4.3/client/Settings.cpp --- old/SoapyRemote-soapy-remote-0.4.2/client/Settings.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/client/Settings.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -18,15 +18,20 @@ _logAcceptor(nullptr), _defaultStreamProt("udp") { + //extract timeout + long timeoutUs = SOAPY_REMOTE_SOCKET_TIMEOUT_US; + const auto timeoutIt = args.find("timeout"); + if (timeoutIt != args.end()) timeoutUs = std::stol(timeoutIt->second); + //try to connect to the remote server - int ret = _sock.connect(url, SOAPY_REMOTE_SOCKET_TIMEOUT_US); + int ret = _sock.connect(url, timeoutUs); if (ret != 0) { throw std::runtime_error("SoapyRemoteDevice("+url+") -- connect FAIL: " + _sock.lastErrorMsg()); } //connect the log acceptor - _logAcceptor = new SoapyLogAcceptor(url, _sock); + _logAcceptor = new SoapyLogAcceptor(url, _sock, timeoutUs); //acquire device instance SoapyRPCPacker packer(_sock); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/client/Streaming.cpp new/SoapyRemote-soapy-remote-0.4.3/client/Streaming.cpp --- old/SoapyRemote-soapy-remote-0.4.2/client/Streaming.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/client/Streaming.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include <SoapySDR/Logger.hpp> @@ -119,6 +119,15 @@ priorityArg.range = SoapySDR::Range(-1.0, 1.0); result.push_back(priorityArg); + SoapySDR::ArgInfo protArg; + protArg.key = "remote:prot"; + protArg.value = "udp"; + protArg.name = "Remote Protocol"; + protArg.description = "Specify the transport protocol for the remote stream."; + protArg.type = SoapySDR::ArgInfo::STRING; + protArg.options = {"udp", "tcp"}; + result.push_back(protArg); + return result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCSocket.cpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCSocket.cpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCSocket.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCSocket.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2016 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "SoapySocketDefs.hpp" @@ -97,6 +97,15 @@ return _sock == INVALID_SOCKET; } +bool SoapyRPCSocket::status(void) +{ + int opt = 0; + socklen_t optlen = sizeof(opt); + ::getsockopt(_sock, SOL_SOCKET, SO_ERROR, (char *)&opt, &optlen); + if (opt != 0) this->reportError("getsockopt(SO_ERROR)", opt); + return opt == 0; +} + int SoapyRPCSocket::close(void) { if (this->null()) return 0; @@ -431,7 +440,7 @@ socklen_t addrlen = sizeof(addr); int ret = ::recvfrom(_sock, (char *)buf, int(len), flags, (struct sockaddr*)&addr, &addrlen); if (ret == -1) this->reportError("recvfrom()"); - else url = SoapyURL(SockAddrData((struct sockaddr *)&addr, addrlen)).toString(); + else url = SoapyURL((struct sockaddr *)&addr).toString(); return ret; } @@ -491,7 +500,7 @@ int ret = ::getsockname(_sock, (struct sockaddr *)&addr, &addrlen); if (ret == -1) this->reportError("getsockname()"); if (ret != 0) return ""; - return SoapyURL(SockAddrData((struct sockaddr *)&addr, addrlen)).toString(); + return SoapyURL((struct sockaddr *)&addr).toString(); } std::string SoapyRPCSocket::getpeername(void) @@ -501,7 +510,7 @@ int ret = ::getpeername(_sock, (struct sockaddr *)&addr, &addrlen); if (ret == -1) this->reportError("getpeername()"); if (ret != 0) return ""; - return SoapyURL(SockAddrData((struct sockaddr *)&addr, addrlen)).toString(); + return SoapyURL((struct sockaddr *)&addr).toString(); } int SoapyRPCSocket::setBuffSize(const bool isRecv, const size_t numBytes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCSocket.hpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCSocket.hpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCSocket.hpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCSocket.hpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #pragma once @@ -45,6 +45,13 @@ bool null(void); /*! + * Is the socket in a good state? + * Return true for good, false for error. + * The last error message will be set on error. + */ + bool status(void); + + /*! * Explicit close the socket, also done by destructor. */ int close(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCUnpacker.cpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCUnpacker.cpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRPCUnpacker.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRPCUnpacker.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2017 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "SoapySocketDefs.hpp" @@ -14,16 +14,20 @@ #include <cstdlib> //malloc #include <algorithm> //min, max #include <stdexcept> +#include <chrono> + +//! How long to wait for the server presence checks +static const long SERVER_CHECK_TIMEOUT_US = 3000000; //3 seconds static void testServerConnection(const std::string &url) { SoapyRPCSocket s; - int ret = s.connect(url, SOAPY_REMOTE_SOCKET_TIMEOUT_US); + int ret = s.connect(url, SERVER_CHECK_TIMEOUT_US); if (ret != 0) throw std::runtime_error("SoapyRPCUnpacker::recv() FAIL test server connection: "+std::string(s.lastErrorMsg())); SoapyRPCPacker packerHangup(s); packerHangup & SOAPY_REMOTE_HANGUP; packerHangup(); - s.selectRecv(SOAPY_REMOTE_SOCKET_TIMEOUT_US); + s.selectRecv(SERVER_CHECK_TIMEOUT_US); } SoapyRPCUnpacker::SoapyRPCUnpacker(SoapyRPCSocket &sock, const bool autoRecv, const long timeoutUs): @@ -38,15 +42,14 @@ //Calls are allowed to take a long time (up to 31 seconds). //However, we continually check that the server is active //so that we can tear down immediately if the server goes away. - if (timeoutUs >= 0) + if (timeoutUs >= SERVER_CHECK_TIMEOUT_US) { - auto subTimeout = std::min<long>(timeoutUs, 1000000); //1 second - while (true) + const auto exitTime = std::chrono::high_resolution_clock::now() + std::chrono::microseconds(timeoutUs); + while (not _sock.selectRecv(SERVER_CHECK_TIMEOUT_US)) { - if (_sock.selectRecv(subTimeout)) break; testServerConnection(_sock.getpeername()); - subTimeout *= 2; //server is up, increase timeout check - if (subTimeout >= timeoutUs) throw std::runtime_error("SoapyRPCUnpacker::recv() TIMEOUT: "+std::string(_sock.lastErrorMsg())); + if (std::chrono::high_resolution_clock::now() > exitTime) + throw std::runtime_error("SoapyRPCUnpacker::recv() TIMEOUT"); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRemoteDefs.hpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRemoteDefs.hpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyRemoteDefs.hpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyRemoteDefs.hpp 2018-03-20 03:42:28.000000000 +0100 @@ -67,7 +67,7 @@ #define SOAPY_REMOTE_DEFAULT_SERVICE "55132" //! Use this timeout for every socket poll loop -#define SOAPY_REMOTE_SOCKET_TIMEOUT_US (500*1000) //500 ms +#define SOAPY_REMOTE_SOCKET_TIMEOUT_US (100*1000) //100 ms //! Backlog count for the server socket listen #define SOAPY_REMOTE_LISTEN_BACKLOG 100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapySSDPEndpoint.cpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapySSDPEndpoint.cpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapySSDPEndpoint.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapySSDPEndpoint.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2016 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 /* @@ -111,6 +111,7 @@ { std::lock_guard<std::mutex> lock(mutex); periodicSearchEnabled = enable; + if (not enable) return; //quiet on disable for (auto &data : handlers) this->sendSearchHeader(data); } @@ -118,6 +119,7 @@ { std::lock_guard<std::mutex> lock(mutex); periodicNotifyEnabled = enable; + if (not enable) return; //quiet on disable for (auto &data : handlers) this->sendNotifyHeader(data, NTS_ALIVE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyURLUtils.cpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyURLUtils.cpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyURLUtils.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyURLUtils.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2015 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "SoapySocketDefs.hpp" @@ -91,13 +91,13 @@ } } -SoapyURL::SoapyURL(const SockAddrData &addr) +SoapyURL::SoapyURL(const struct sockaddr *addr) { char *s = NULL; - switch(addr.addr()->sa_family) + switch(addr->sa_family) { case AF_INET: { - auto *addr_in = (const struct sockaddr_in *)addr.addr(); + auto *addr_in = (const struct sockaddr_in *)addr; s = (char *)malloc(INET_ADDRSTRLEN); inet_ntop(AF_INET, (void *)&(addr_in->sin_addr), s, INET_ADDRSTRLEN); _node = s; @@ -105,7 +105,7 @@ break; } case AF_INET6: { - auto *addr_in6 = (const struct sockaddr_in6 *)addr.addr(); + auto *addr_in6 = (const struct sockaddr_in6 *)addr; s = (char *)malloc(INET6_ADDRSTRLEN); inet_ntop(AF_INET6, (void *)&(addr_in6->sin6_addr), s, INET6_ADDRSTRLEN); _node = s; @@ -123,6 +123,11 @@ free(s); } +SoapyURL::SoapyURL(const SockAddrData &addr) +{ + *this = SoapyURL(addr.addr()); +} + std::string SoapyURL::toSockAddr(SockAddrData &addr) const { SockAddrData result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/common/SoapyURLUtils.hpp new/SoapyRemote-soapy-remote-0.4.3/common/SoapyURLUtils.hpp --- old/SoapyRemote-soapy-remote-0.4.2/common/SoapyURLUtils.hpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/common/SoapyURLUtils.hpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2015 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #pragma once @@ -46,6 +46,9 @@ SoapyURL(const std::string &url); //! Create URL from socket address + SoapyURL(const struct sockaddr *addr); + + //! Create URL from socket address SoapyURL(const SockAddrData &addr); /*! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/debian/changelog new/SoapyRemote-soapy-remote-0.4.3/debian/changelog --- old/SoapyRemote-soapy-remote-0.4.2/debian/changelog 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/debian/changelog 2018-03-20 03:42:28.000000000 +0100 @@ -1,3 +1,9 @@ +soapyremote (0.4.3-1) unstable; urgency=low + + * Release 0.4.3 (2018-03-19) + + -- Josh Blum <[email protected]> Mon, 19 Mar 2018 21:42:06 -0000 + soapyremote (0.4.2-1) unstable; urgency=low * Release 0.4.2 (2017-07-31) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/debian/control new/SoapyRemote-soapy-remote-0.4.3/debian/control --- old/SoapyRemote-soapy-remote-0.4.2/debian/control 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/debian/control 2018-03-20 03:42:28.000000000 +0100 @@ -6,7 +6,7 @@ debhelper (>= 9.0.0), cmake, libsoapysdr-dev (>= 0.3.0) -Standards-Version: 3.9.8 +Standards-Version: 4.1.1 Homepage: https://github.com/pothosware/SoapyRemote/wiki Vcs-Git: https://github.com/pothosware/SoapyRemote.git Vcs-Browser: https://github.com/pothosware/SoapyRemote diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/debian/copyright new/SoapyRemote-soapy-remote-0.4.3/debian/copyright --- old/SoapyRemote-soapy-remote-0.4.2/debian/copyright 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/debian/copyright 2018-03-20 03:42:28.000000000 +0100 @@ -4,7 +4,7 @@ Files: * Copyright: - Copyright (c) 2015-2017 Josh Blum <[email protected]> + Copyright (c) 2015-2018 Josh Blum <[email protected]> Copyright (c) 2016-2016 Bastille Networks License: BSL-1.0 Boost Software License - Version 1.0 - August 17th, 2003 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.4.2/server/SoapyServer.cpp new/SoapyRemote-soapy-remote-0.4.3/server/SoapyServer.cpp --- old/SoapyRemote-soapy-remote-0.4.2/server/SoapyServer.cpp 2017-07-31 16:15:38.000000000 +0200 +++ new/SoapyRemote-soapy-remote-0.4.3/server/SoapyServer.cpp 2018-03-20 03:42:28.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2015 Josh Blum +// Copyright (c) 2015-2018 Josh Blum // SPDX-License-Identifier: BSL-1.0 #include "SoapyServer.hpp" @@ -75,7 +75,16 @@ std::cout << "Press Ctrl+C to stop the server" << std::endl; signal(SIGINT, sigIntHandler); - while (not serverDone) serverListener->handleOnce(); + bool exitFailure = false; + while (not serverDone) + { + serverListener->handleOnce(); + if (s.status()) continue; + std::cerr << "Server socket failure: " << s.lastErrorMsg() << std::endl; + std::cerr << "Exiting prematurely..." << std::endl; + serverDone = true; + exitFailure = true; + } ssdpEndpoint->enablePeriodicNotify(false); ssdpEndpoint.reset(); @@ -84,7 +93,7 @@ s.close(); std::cout << "Cleanup complete, exiting" << std::endl; - return EXIT_SUCCESS; + return exitFailure?EXIT_FAILURE:EXIT_SUCCESS; } /***********************************************************************
