X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fconnect.c;h=b54db2384c93e940146db6503c4959a36bccf00a;hb=a9a2b34b052cfa903462124f59fbfeed7eaf374b;hp=1e8f07e5fcd98755ac8b5f78d763192b249c3434;hpb=2e2ac6ad2fc90eaf46ae5fee0bc4f61dd97b4284;p=wget diff --git a/src/connect.c b/src/connect.c index 1e8f07e5..b54db238 100644 --- a/src/connect.c +++ b/src/connect.c @@ -39,7 +39,11 @@ as that of the covered work. */ #ifndef WINDOWS # include -# include +# ifdef __VMS +# include "vms_ip.h" +# else /* def __VMS */ +# include +# endif /* def __VMS [else] */ # include # ifndef __BEOS__ # include @@ -59,6 +63,11 @@ as that of the covered work. */ #include "connect.h" #include "hash.h" +/* Apparently needed for Interix: */ +#ifdef HAVE_STDINT_H +# include +#endif + /* Define sockaddr_storage where unavailable (presumably on IPv4-only hosts). */ @@ -266,9 +275,25 @@ connect_to_ip (const ip_address *ip, int port, const char *print) if (print) { const char *txt_addr = print_address (ip); - if (print && 0 != strcmp (print, txt_addr)) - logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "), - escnonprint_uri (print), txt_addr, port); + if (0 != strcmp (print, txt_addr)) + { + 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); }