0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

Revert "ircd::net: Remove string(net::hostport) branch ..." w/ improvement.

This reverts commit fa19b9b182 with modification.
This commit is contained in:
Jason Volk 2020-03-07 14:20:51 -08:00
parent dddb8e4254
commit 9cceed8d34

View file

@ -4496,6 +4496,14 @@ ircd::net::string(const mutable_buffer &buf,
port(hp)
};
if(!empty(service(hp)) && port(hp) == 0)
return fmt::sprintf
{
buf, "%s:%s",
tolower(tlbuf[0], host(hp)),
tolower(tlbuf[1], service(hp)),
};
return fmt::sprintf
{
buf, "%s:%u (%s)",