Changeset View
Changeset View
Standalone View
Standalone View
src/netbase.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | bool fMultiColon = | ||||
fHaveColon && (in.find_last_of(':', colon - 1) != in.npos); | fHaveColon && (in.find_last_of(':', colon - 1) != in.npos); | ||||
if (fHaveColon && (colon == 0 || fBracketed || !fMultiColon)) { | if (fHaveColon && (colon == 0 || fBracketed || !fMultiColon)) { | ||||
int32_t n; | int32_t n; | ||||
if (ParseInt32(in.substr(colon + 1), &n) && n > 0 && n < 0x10000) { | if (ParseInt32(in.substr(colon + 1), &n) && n > 0 && n < 0x10000) { | ||||
in = in.substr(0, colon); | in = in.substr(0, colon); | ||||
portOut = n; | portOut = n; | ||||
} | } | ||||
} | } | ||||
if (in.size() > 0 && in[0] == '[' && in[in.size() - 1] == ']') | if (in.size() > 0 && in[0] == '[' && in[in.size() - 1] == ']') { | ||||
hostOut = in.substr(1, in.size() - 2); | hostOut = in.substr(1, in.size() - 2); | ||||
else | } else { | ||||
hostOut = in; | hostOut = in; | ||||
} | } | ||||
} | |||||
static bool LookupIntern(const char *pszName, std::vector<CNetAddr> &vIP, | static bool LookupIntern(const char *pszName, std::vector<CNetAddr> &vIP, | ||||
unsigned int nMaxSolutions, bool fAllowLookup) { | unsigned int nMaxSolutions, bool fAllowLookup) { | ||||
vIP.clear(); | vIP.clear(); | ||||
{ | { | ||||
CNetAddr addr; | CNetAddr addr; | ||||
if (addr.SetSpecial(std::string(pszName))) { | if (addr.SetSpecial(std::string(pszName))) { | ||||
▲ Show 20 Lines • Show All 655 Lines • Show Last 20 Lines |