diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-29 08:00:13 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-11-11 10:17:06 +1000 |
commit | 0f90613cbe69dfa422e8802c63844f816c3ca588 (patch) | |
tree | 9b49e2042960c70c035c0988d1f2871194629bbd | |
parent | 3a6faabecf719633481253a0d2f874494ad126a5 (diff) |
Improve logging of failed connections
-rw-r--r-- | src/netbase.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 88c58f854e..1392fa8233 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -367,13 +367,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe int nRet = select(hSocket + 1, NULL, &fdset, NULL, &timeout); if (nRet == 0) { - LogPrint("net", "connection timeout\n"); + LogPrint("net", "connection to %s timeout\n", addrConnect.ToString().c_str()); closesocket(hSocket); return false; } if (nRet == SOCKET_ERROR) { - LogPrintf("select() for connection failed: %i\n",WSAGetLastError()); + LogPrintf("select() for %s failed: %i\n", addrConnect.ToString().c_str(), WSAGetLastError()); closesocket(hSocket); return false; } @@ -384,13 +384,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR) #endif { - LogPrintf("getsockopt() for connection failed: %i\n",WSAGetLastError()); + LogPrintf("getsockopt() for %s failed: %i\n", addrConnect.ToString().c_str(), WSAGetLastError()); closesocket(hSocket); return false; } if (nRet != 0) { - LogPrintf("connect() failed after select(): %s\n",strerror(nRet)); + LogPrintf("connect() to %s failed after select(): %s\n", addrConnect.ToString().c_str(), strerror(nRet)); closesocket(hSocket); return false; } @@ -401,7 +401,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe else #endif { - LogPrintf("connect() failed: %i\n",WSAGetLastError()); + LogPrintf("connect() to %s failed: %i\n", addrConnect.ToString().c_str(), WSAGetLastError()); closesocket(hSocket); return false; } |