| 255 | } |
| 256 | |
| 257 | CService LookupNumeric(const std::string &name, uint16_t portDefault, |
| 258 | DNSLookupFn dns_lookup_function) { |
| 259 | if (!ContainsNoNUL(name)) { |
| 260 | return {}; |
| 261 | } |
| 262 | // "1.2:345" will fail to resolve the ip, but will still set the port. |
| 263 | // If the ip fails to resolve, re-init the result. |
| 264 | return Lookup(name, portDefault, /*fAllowLookup=*/false, |
| 265 | dns_lookup_function) |
| 266 | .value_or(CService{}); |
| 267 | } |
| 268 | |
| 269 | bool IsUnixSocketPath(const std::string &name) { |
| 270 | #if HAVE_SOCKADDR_UN |