diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-17 16:17:11 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-17 16:59:59 +0200 |
commit | 3afd81df9b58a1a0356a1104bb80d17165f5787b (patch) | |
tree | 607cb9a850ba91888dc185ca749596dfa38e249f /common.c | |
parent | 8632e5fe8335476b82233708dd3d751cf1e7026b (diff) | |
download | xK-3afd81df9b58a1a0356a1104bb80d17165f5787b.tar.gz xK-3afd81df9b58a1a0356a1104bb80d17165f5787b.tar.xz xK-3afd81df9b58a1a0356a1104bb80d17165f5787b.zip |
Deal better with displaying IPv6 addresses
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 * |