]> sjero.net Git - wget/blobdiff - src/host.c
[svn] Renamed DEBUG to ENABLE_DEBUG.
[wget] / src / host.c
index 12b80602146f4b615c761ae2fea3106a650d3200..601487aeecabb6e25209f80a867813102d90543f 100644 (file)
@@ -494,7 +494,7 @@ gethostbyname_with_timeout_callback (void *arg)
    other than timeout, errno is reset.  */
 
 static struct hostent *
-gethostbyname_with_timeout (const char *host_name, int timeout)
+gethostbyname_with_timeout (const char *host_name, double timeout)
 {
   struct ghbnwt_context ctx;
   ctx.host_name = host_name;
@@ -533,7 +533,7 @@ getaddrinfo_with_timeout_callback (void *arg)
 static int
 getaddrinfo_with_timeout (const char *node, const char *service,
                          const struct addrinfo *hints, struct addrinfo **res,
-                         int timeout)
+                         double timeout)
 {
   struct gaiwt_context ctx;
   ctx.node = node;
@@ -585,7 +585,7 @@ cache_host_lookup (const char *host, struct address_list *al)
   ++al->refcount;
   hash_table_put (host_name_addresses_map, xstrdup_lower (host), al);
 
-#ifdef DEBUG
+#ifdef ENABLE_DEBUG
   if (opt.debug)
     {
       int i;
@@ -656,7 +656,7 @@ lookup_host (const char *host, int silent)
     else
       hints.ai_family   = PF_UNSPEC;
     hints.ai_socktype = SOCK_STREAM;
-    err = getaddrinfo_with_timeout (host, NULL, &hints, &ai, opt.timeout);
+    err = getaddrinfo_with_timeout (host, NULL, &hints, &ai, opt.dns_timeout);
 
     if (err != 0 || ai == NULL)
       {
@@ -670,7 +670,8 @@ lookup_host (const char *host, int silent)
   }
 #else
   {
-    struct hostent *hptr = gethostbyname_with_timeout (host, opt.timeout);
+    struct hostent *hptr;
+    hptr = gethostbyname_with_timeout (host, opt.dns_timeout);
     if (!hptr)
       {
        if (!silent)