Deal better with displaying IPv6 addresses

This commit is contained in:
2014-08-17 16:17:11 +02:00
parent 8632e5fe83
commit 3afd81df9b
3 changed files with 30 additions and 12 deletions

View File

@@ -1604,6 +1604,15 @@ xssl_get_error (SSL *ssl, int result, const char **error_info)
}
}
static char *
format_host_port_pair (const char *host, const char *port)
{
// IPv6 addresses mess with the "colon notation"; let's go with RFC 2732
if (strchr (host, ':'))
return xstrdup_printf ("[%s]:%s", host, port);
return xstrdup_printf ("%s:%s", host, port);
}
// --- Regular expressions -----------------------------------------------------
static regex_t *