From 6050ab685553c7312ef105d2c4a5230c3fcf4002 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 8 Sep 2014 13:49:56 +0200 Subject: netbase: Make SOCKS5 negotiation interruptible Avoids that SOCKS5 negotiation will hold up the shutdown process. - Sockets can stay in non-blocking mode, no need to switch it on/off anymore - Adds a timeout (20 seconds) on SOCK5 negotiation. This should be enough for even Tor to get a connection to a hidden service, and avoids blocking the opencon thread indefinitely on a hanging proxy. Fixes #2954. --- src/net.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index 633a3a34e7..4c9ff4ebed 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -488,10 +488,6 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { addrman.Attempt(addrConnect); - // Set to non-blocking - if (!SetSocketNonBlocking(hSocket, true)) - LogPrintf("ConnectNode: Setting socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError())); - // Add node CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : "", false); pnode->AddRef(); -- cgit v1.2.3