aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-09-18 20:38:08 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-09-18 20:39:25 +1000
commit881a85a22d76c875f519cd54388a419ec6f70857 (patch)
tree3f71daa59ac35c5dda44747c0b62dbc8602d8f1c /src/netbase.cpp
parente51321fb75f00194425e5ecc8ad77fd6762ec221 (diff)
Replace printf with LogPrintf / LogPrint
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index d02490ad4a..acc2ae32aa 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -169,7 +169,7 @@ bool LookupNumeric(const char *pszName, CService& addr, int portDefault)
bool static Socks4(const CService &addrDest, SOCKET& hSocket)
{
- printf("SOCKS4 connecting %s\n", addrDest.ToString().c_str());
+ LogPrintf("SOCKS4 connecting %s\n", addrDest.ToString().c_str());
if (!addrDest.IsIPv4())
{
closesocket(hSocket);
@@ -204,16 +204,16 @@ bool static Socks4(const CService &addrDest, SOCKET& hSocket)
{
closesocket(hSocket);
if (pchRet[1] != 0x5b)
- printf("ERROR: Proxy returned error %d\n", pchRet[1]);
+ LogPrintf("ERROR: Proxy returned error %d\n", pchRet[1]);
return false;
}
- printf("SOCKS4 connected %s\n", addrDest.ToString().c_str());
+ LogPrintf("SOCKS4 connected %s\n", addrDest.ToString().c_str());
return true;
}
bool static Socks5(string strDest, int port, SOCKET& hSocket)
{
- printf("SOCKS5 connecting %s\n", strDest.c_str());
+ LogPrintf("SOCKS5 connecting %s\n", strDest.c_str());
if (strDest.size() > 255)
{
closesocket(hSocket);
@@ -309,7 +309,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket)
closesocket(hSocket);
return error("Error reading from proxy");
}
- printf("SOCKS5 connected %s\n", strDest.c_str());
+ LogPrintf("SOCKS5 connected %s\n", strDest.c_str());
return true;
}
@@ -324,7 +324,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
#endif
socklen_t len = sizeof(sockaddr);
if (!addrConnect.GetSockAddr((struct sockaddr*)&sockaddr, &len)) {
- printf("Cannot connect to %s: unsupported network\n", addrConnect.ToString().c_str());
+ LogPrintf("Cannot connect to %s: unsupported network\n", addrConnect.ToString().c_str());
return false;
}
@@ -363,13 +363,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
int nRet = select(hSocket + 1, NULL, &fdset, NULL, &timeout);
if (nRet == 0)
{
- printf("connection timeout\n");
+ LogPrint("net", "connection timeout\n");
closesocket(hSocket);
return false;
}
if (nRet == SOCKET_ERROR)
{
- printf("select() for connection failed: %i\n",WSAGetLastError());
+ LogPrintf("select() for connection failed: %i\n",WSAGetLastError());
closesocket(hSocket);
return false;
}
@@ -380,13 +380,13 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR)
#endif
{
- printf("getsockopt() for connection failed: %i\n",WSAGetLastError());
+ LogPrintf("getsockopt() for connection failed: %i\n",WSAGetLastError());
closesocket(hSocket);
return false;
}
if (nRet != 0)
{
- printf("connect() failed after select(): %s\n",strerror(nRet));
+ LogPrintf("connect() failed after select(): %s\n",strerror(nRet));
closesocket(hSocket);
return false;
}
@@ -397,7 +397,7 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe
else
#endif
{
- printf("connect() failed: %i\n",WSAGetLastError());
+ LogPrintf("connect() failed: %i\n",WSAGetLastError());
closesocket(hSocket);
return false;
}
@@ -893,7 +893,7 @@ uint64 CNetAddr::GetHash() const
void CNetAddr::print() const
{
- printf("CNetAddr(%s)\n", ToString().c_str());
+ LogPrintf("CNetAddr(%s)\n", ToString().c_str());
}
// private extensions to enum Network, only returned by GetExtNetwork,
@@ -1134,7 +1134,7 @@ std::string CService::ToString() const
void CService::print() const
{
- printf("CService(%s)\n", ToString().c_str());
+ LogPrintf("CService(%s)\n", ToString().c_str());
}
void CService::SetPort(unsigned short portIn)