0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 18:18:35 +02: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]; thread_local char buf[256];
const critical_assertion ca; const critical_assertion ca;
s << string(buf, t); s << net::string(buf, t);
return s; return s;
} }
@ -3449,16 +3449,18 @@ ircd::net::string(const mutable_buffer &buf,
{ {
const auto len const auto len
{ {
is_v4(ipp)? is_v4(ipp)? fmt::sprintf
fmt::sprintf(buf, "%s:%u", {
ip::address_v4{host4(ipp)}.to_string(), buf, "%s:%u",
port(ipp)): ip::address_v4{host4(ipp)}.to_string(),
port(ipp)
is_v6(ipp)? }:
fmt::sprintf(buf, "%s:%u", is_v6(ipp)? fmt::sprintf
ip::address_v6{std::get<ipp.IP>(ipp)}.to_string(), {
port(ipp)): buf, "%s:%u",
ip::address_v6{std::get<ipp.IP>(ipp)}.to_string(),
port(ipp)
}:
0 0
}; };