mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
replace 3 separate calls to WSAGetLastError() with 1
This commit is contained in:
parent
36db6633c3
commit
6dc90ed8fa
@ -337,8 +337,9 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
|
|||||||
|
|
||||||
if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)
|
if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
|
int nErr = WSAGetLastError();
|
||||||
// WSAEINVAL is here because some legacy version of winsock uses it
|
// 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;
|
struct timeval timeout;
|
||||||
timeout.tv_sec = nTimeout / 1000;
|
timeout.tv_sec = nTimeout / 1000;
|
||||||
|
Loading…
Reference in New Issue
Block a user