Permalink
Browse files

replace 3 separate calls to WSAGetLastError() with 1

  • Loading branch information...
Tranz5 committed Aug 15, 2014
1 parent 85a8de3 commit 4c9a74c97ad994db7e60a9bda5eb431b95f1e1b3
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/netbase.cpp
View
@@ -338,8 +338,9 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)
{
int nErr = WSAGetLastError();
// WSAEINVAL is here because some legacy version of winsock uses it
if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL)
if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)
{
struct timeval timeout;
timeout.tv_sec = nTimeout / 1000;

0 comments on commit 4c9a74c

Please sign in to comment.