| 168 | } |
| 169 | |
| 170 | bool LookupHost(const std::string& name, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup, DNSLookupFn dns_lookup_function) |
| 171 | { |
| 172 | if (!ValidAsCString(name)) { |
| 173 | return false; |
| 174 | } |
| 175 | std::string strHost = name; |
| 176 | if (strHost.empty()) |
| 177 | return false; |
| 178 | if (strHost.front() == '[' && strHost.back() == ']') { |
| 179 | strHost = strHost.substr(1, strHost.size() - 2); |
| 180 | } |
| 181 | |
| 182 | return LookupIntern(strHost, vIP, nMaxSolutions, fAllowLookup, dns_lookup_function); |
| 183 | } |
| 184 | |
| 185 | bool LookupHost(const std::string& name, CNetAddr& addr, bool fAllowLookup, DNSLookupFn dns_lookup_function) |
| 186 | { |