0
0
Fork 0
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:
Jason Volk 2018-05-02 12:12:19 -07:00
parent c84fe8d962
commit 695fb4c9b0

View file

@ -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
};