aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-07-09 18:23:27 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2015-07-10 12:05:09 -0400
commitd422f9b1fdb42a51aadaa1bbc157542dca2feb17 (patch)
treebaca8c375b2e39e5fac9669adfe117c25bec682e /src/netbase.cpp
parent943b322d5d292707e193f3a9d8e971881540be23 (diff)
Test whether created sockets are select()able
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index c9fc7d67f7..b7e2e57917 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -266,6 +266,9 @@ bool static InterruptibleRecv(char* data, size_t len, int timeout, SOCKET& hSock
} else { // Other error or blocking
int nErr = WSAGetLastError();
if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {
+ if (!IsSelectableSocket(hSocket)) {
+ return false;
+ }
struct timeval tval = MillisToTimeval(std::min(endTime - curTime, maxWait));
fd_set fdset;
FD_ZERO(&fdset);