diff options
| author | Saint Xavier <wget@sxav.eu> | 2008-07-08 00:42:09 +0200 |
|---|---|---|
| committer | Saint Xavier <wget@sxav.eu> | 2008-07-08 00:42:09 +0200 |
| commit | f50be2a403574a8d2cc01f4be714da9c2d6f748a (patch) | |
| tree | a8b069e815ba2744945dbbaab38a83d9f553ac76 /src/connect.c | |
| parent | 3781197ec61b6050222df10206c201c185c8fe2d (diff) | |
| download | wget-f50be2a403574a8d2cc01f4be714da9c2d6f748a.tar.gz | |
Show the hostname we are connecting to in the locale when possible
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/connect.c b/src/connect.c index a6ff0b9b..6cfdb4b7 100644 --- a/src/connect.c +++ b/src/connect.c @@ -58,6 +58,7 @@ as that of the covered work. */ #include "host.h" #include "connect.h" #include "hash.h" +#include "iri.h" /* Define sockaddr_storage where unavailable (presumably on IPv4-only hosts). */ @@ -267,8 +268,24 @@ connect_to_ip (const ip_address *ip, int port, const char *print) { const char *txt_addr = print_address (ip); if (0 != strcmp (print, txt_addr)) - logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "), - escnonprint_uri (print), txt_addr, port); + { + char *str = NULL, *name; + + if (opt.enable_iri && (name = idn_decode ((char *) print)) != NULL) + { + int len = strlen (print) + strlen (name) + 4; + str = xmalloc (len); + snprintf (str, len, "%s (%s)", name, print); + str[len-1] = '\0'; + xfree (name); + } + + logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "), + str ? str : escnonprint_uri (print), txt_addr, port); + + if (str) + xfree (str); + } else logprintf (LOG_VERBOSE, _("Connecting to %s:%d... "), txt_addr, port); } |
