Merge pull request #4390

6dc90ed replace 3 separate calls to WSAGetLastError() with 1 (Philip Kaufmann)
This commit is contained in:
Wladimir J. van der Laan 2014-06-25 07:16:20 +02:00
commit 27383b9015
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -337,8 +337,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;