mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd::net: Ensure proper string() is resolved; minor cleanup.
This commit is contained in:
parent
c84fe8d962
commit
695fb4c9b0
1 changed files with 13 additions and 11 deletions
24
ircd/net.cc
24
ircd/net.cc
|
@ -3405,7 +3405,7 @@ ircd::net::operator<<(std::ostream &s, const ipport &t)
|
|||
{
|
||||
thread_local char buf[256];
|
||||
const critical_assertion ca;
|
||||
s << string(buf, t);
|
||||
s << net::string(buf, t);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -3449,16 +3449,18 @@ ircd::net::string(const mutable_buffer &buf,
|
|||
{
|
||||
const auto len
|
||||
{
|
||||
is_v4(ipp)?
|
||||
fmt::sprintf(buf, "%s:%u",
|
||||
ip::address_v4{host4(ipp)}.to_string(),
|
||||
port(ipp)):
|
||||
|
||||
is_v6(ipp)?
|
||||
fmt::sprintf(buf, "%s:%u",
|
||||
ip::address_v6{std::get<ipp.IP>(ipp)}.to_string(),
|
||||
port(ipp)):
|
||||
|
||||
is_v4(ipp)? fmt::sprintf
|
||||
{
|
||||
buf, "%s:%u",
|
||||
ip::address_v4{host4(ipp)}.to_string(),
|
||||
port(ipp)
|
||||
}:
|
||||
is_v6(ipp)? fmt::sprintf
|
||||
{
|
||||
buf, "%s:%u",
|
||||
ip::address_v6{std::get<ipp.IP>(ipp)}.to_string(),
|
||||
port(ipp)
|
||||
}:
|
||||
0
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue