X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fnetbase.cpp;fp=src%2Fnetbase.cpp;h=07ee7f7ae999cefb2dba1898d2db4537f19445e6;hp=b68a43a2fa353cdc569e196f5dc448b382c7d1ae;hb=60cf27d9500deb3bc80ffa8ce5dc3e8284a4c658;hpb=3fa5baa680a6c95f62454e421b02f91247164d9d diff --git a/src/netbase.cpp b/src/netbase.cpp index b68a43a..07ee7f7 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -21,8 +21,6 @@ typedef SSIZE_T ssize_t; #endif -#include // for to_lower() -#include // for startswith() and endswith() using namespace std; @@ -36,7 +34,7 @@ bool fNameLookup = false; static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; enum Network ParseNetwork(std::string net) { - boost::to_lower(net); + transform(net.begin(), net.end(), net.begin(), ::tolower); if (net == "ipv4") return NET_IPV4; if (net == "ipv6") return NET_IPV6; if (net == "tor" || net == "onion") return NET_TOR; @@ -128,7 +126,7 @@ bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nM std::string strHost(pszName); if (strHost.empty()) return false; - if (boost::algorithm::starts_with(strHost, "[") && boost::algorithm::ends_with(strHost, "]")) + if ((strHost.compare(0,1, "[") == 0) && (strHost.compare(strHost.length()-1,1, "]") == 0)) { strHost = strHost.substr(1, strHost.size() - 2); }