diff --git a/ircd/net.cc b/ircd/net.cc index b5436f978..d2cf9a615 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -3792,18 +3792,24 @@ ircd::string_view ircd::net::string(const mutable_buffer &buf, const hostport &hp) { - if(empty(service(hp))) + if(empty(service(hp)) && port(hp) == 0) + return fmt::sprintf + { + buf, "%s", host(hp) + }; + + if(!empty(service(hp))) + return fmt::sprintf + { + buf, "%s:%s", host(hp), service(hp) + }; + + if(empty(service(hp)) && port(hp) != 0) return fmt::sprintf { buf, "%s:%u", host(hp), port(hp) }; - if(port(hp) == 0) - return fmt::sprintf - { - buf, "%s (%s)", host(hp), service(hp) - }; - return fmt::sprintf { buf, "%s:%u (%s)", host(hp), port(hp), service(hp)