From 4e5ea71bd513ba1a5d19afbdfb545ed36560c546 Mon Sep 17 00:00:00 2001 From: J Ross Nicoll Date: Sat, 29 Aug 2015 17:40:13 +0100 Subject: Make sure LogPrint strings are line-terminated --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index 7ed9d65fb2..f18c903aea 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -575,7 +575,7 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes) return false; if (msg.in_data && msg.hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) { - LogPrint("net", "Oversized message from peer=%i, disconnecting", GetId()); + LogPrint("net", "Oversized message from peer=%i, disconnecting\n", GetId()); return false; } -- cgit v1.2.3 From c9ad65e5fafc47ea74399e8057e445e0e0435101 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 20 Aug 2015 15:50:13 -0400 Subject: net: Set SO_REUSEADDR for Windows too When running the rpc tests in Wine, nodes often fail to listen on localhost due to a stale socket from a previous run. This aligns the behavior with other platforms. --- src/net.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index f18c903aea..80cecd0724 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1506,8 +1506,10 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int)); #endif // Allow binding if the port is still in TIME_WAIT state after - // the program was closed and restarted. Not an issue on windows! + // the program was closed and restarted. setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int)); +#else + setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&nOne, sizeof(int)); #endif // Set to non-blocking, incoming connections will also inherit this -- cgit v1.2.3 From 2ede6b7142cb57c422126722f845b36da7d3c4ef Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Sun, 23 Aug 2015 23:53:49 +0300 Subject: add support for miniupnpc api version 14 The value of new arg ttl is set to 2 as it's recommended default. --- src/net.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index 80cecd0724..5b79812def 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1020,10 +1020,14 @@ void ThreadMapPort() #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); -#else +#elif MINIUPNPC_API_VERSION < 14 /* miniupnpc 1.6 */ int error = 0; devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); +#else + /* miniupnpc 1.9.20150730 */ + int error = 0; + devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error); #endif struct UPNPUrls urls; -- cgit v1.2.3