cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cleaning up lib/hostip.c

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 22 Apr 2004 16:17:07 +0200 (CEST)

On Thu, 22 Apr 2004, Gisle Vanem wrote:

> The Curl_inet_ntop() in dump_addrinfo() will probably go away, unless we add
> inet_ntop.* (attached).

Have you gotten it to work properly? I added it to my build and tried this:

--- lib/url.c
+++ lib/url.c
@@ -1894,6 +1905,10 @@
     if(dns) {
       struct addrinfo *ai = dns->addr;

+ infof(data, "host is: %s", Curl_inet_ntop(ai->ai_family,
+ ai->ai_addr,
+ hbuf, sizeof(hbuf)));
+
       /* Lookup the name of the given address. This should probably be remade
          to use the DNS cache instead, as the host name is most likely cached
          already. */

I build on a ipv6-enabled Linux, and then when trying 'curl -v localhost' this
line claims:

* host is: 2.0.0.80

It seems there's a (network?) byte order problem or something but I can't
understand why...

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-04-22