From 49b22928ee71f18f3cba0245e8b91a11e305183d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 31 May 2015 15:44:22 +0200 Subject: [PATCH 1/2] [net, trivial] explicitly use std::string for FindNode - in OpenNetworkConnection we have a FindNode call, which gets a const char*, wheras we only have defined a FindNode for std::string --- src/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 6849d7926..3908be682 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1363,7 +1363,7 @@ bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOu FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort())) return false; - } else if (FindNode(pszDest)) + } else if (FindNode(std::string(pszDest))) return false; CNode* pnode = ConnectNode(addrConnect, pszDest); @@ -1385,7 +1385,7 @@ void ThreadMessageHandler() { boost::mutex condition_mutex; boost::unique_lock lock(condition_mutex); - + SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL); while (true) { From d6922aad2c054667efede271c4198247edd6f6ad Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 31 May 2015 15:48:23 +0200 Subject: [PATCH 2/2] [net, trivial] remove using namespace std pollution in netbase.cpp --- src/netbase.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 41cc18d3c..e3cb4e706 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -35,8 +35,6 @@ #define MSG_NOSIGNAL 0 #endif -using namespace std; - // Settings static proxyType proxyInfo[NET_MAX]; static proxyType nameProxy; @@ -597,13 +595,13 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout, b bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed) { - string strDest; + std::string strDest; int port = portDefault; if (outProxyConnectionFailed) *outProxyConnectionFailed = false; - SplitHostPort(string(pszDest), port, strDest); + SplitHostPort(std::string(pszDest), port, strDest); proxyType nameProxy; GetNameProxy(nameProxy);