| 1081 | } |
| 1082 | |
| 1083 | EndPoint EndPoint::parse(std::string_view s, uint16_t default_port) { |
| 1084 | if (s.empty()) return {}; |
| 1085 | int port = parse_port((estring_view&)s); |
| 1086 | if (port < 0) port = default_port; |
| 1087 | IPAddr addr; |
| 1088 | parse_addr(s, &addr); |
| 1089 | if (addr.undefined()) return {}; |
| 1090 | return {addr, (uint16_t)port}; |
| 1091 | } |
| 1092 | |
| 1093 | LogBuffer& operator<<(LogBuffer& log, const IPAddr& addr) { |
| 1094 | if (addr.is_ipv4()) |
nothing calls this directly
no test coverage detected