]> sjero.net Git - wget/blobdiff - src/host.c
[svn] Remove K&R support.
[wget] / src / host.c
index 14a7a29d11d6ee8af62fa6b79090b9d7fc0257e8..d9753ab63f1ee7df741eb108928d923b1862fe82 100644 (file)
@@ -35,13 +35,8 @@ so, delete this exception statement from your version.  */
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
 #include <assert.h>
-#include <sys/types.h>
 
 #ifndef WINDOWS
 # include <sys/socket.h>
@@ -64,16 +59,6 @@ so, delete this exception statement from your version.  */
 #include "hash.h"
 #include "connect.h"           /* for socket_has_inet6 */
 
-#ifndef errno
-extern int errno;
-#endif
-
-#ifndef h_errno
-# ifndef __CYGWIN__
-extern int h_errno;
-# endif
-#endif
-
 #ifndef NO_ADDRESS
 # define NO_ADDRESS NO_DATA
 #endif
@@ -311,10 +296,11 @@ void
 address_list_release (struct address_list *al)
 {
   --al->refcount;
-  DEBUGP (("Releasing %p (new refcount %d).\n", al, al->refcount));
+  DEBUGP (("Releasing 0x%0*lx (new refcount %d).\n", PTR_FORMAT (al),
+          al->refcount));
   if (al->refcount <= 0)
     {
-      DEBUGP (("Deleting unused %p.\n", al));
+      DEBUGP (("Deleting unused 0x%0*lx.\n", PTR_FORMAT (al)));
       address_list_delete (al);
     }
 }
@@ -766,17 +752,11 @@ lookup_host (const char *host, int flags)
     else if (opt.ipv6_only)
       hints.ai_family = AF_INET6;
     else
-      {
+      /* We tried using AI_ADDRCONFIG, but removed it because: it
+        misinterprets IPv6 loopbacks, it is broken on AIX 5.1, and
+        it's unneeded since we sort the addresses anyway.  */
        hints.ai_family = AF_UNSPEC;
-#ifdef AI_ADDRCONFIG
-       hints.ai_flags |= AI_ADDRCONFIG;
-#else
-       /* On systems without AI_ADDRCONFIG, emulate it by manually
-          checking whether the system supports IPv6 sockets.  */
-       if (!socket_has_inet6 ())
-         hints.ai_family = AF_INET;
-#endif
-      }
+
     if (flags & LH_BIND)
       hints.ai_flags |= AI_PASSIVE;