1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 09:04:14 +00:00

Merge pull request #1864 from Vort/ipv6_brackets

enclose IPv6 address in square brackets
This commit is contained in:
orignal 2023-01-31 18:21:05 -05:00 committed by GitHub
commit 89695a7040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,14 +329,15 @@ namespace http {
default: default:
s << tr("Unknown"); s << tr("Unknown");
} }
if (address->IsV6 ()) bool v6 = address->IsV6 ();
if (v6)
{ {
if (address->IsV4 ()) s << "v4"; if (address->IsV4 ()) s << "v4";
s << "v6"; s << "v6";
} }
s << "</td>\r\n"; s << "</td>\r\n";
if (address->published) if (address->published)
s << "<td>" << address->host.to_string() << ":" << address->port << "</td>\r\n"; s << "<td>" << (v6 ? "[" : "") << address->host.to_string() << (v6 ? "]:" : ":") << address->port << "</td>\r\n";
else else
{ {
s << "<td>" << tr(/* tr: Shown when router doesn't publish itself and have "Firewalled" state */ "supported"); s << "<td>" << tr(/* tr: Shown when router doesn't publish itself and have "Firewalled" state */ "supported");