]> sjero.net Git - wget/blobdiff - src/http.c
Merging with previous Makefile.in updates.
[wget] / src / http.c
index e2cee5894db141ef34ce18ddd9985bee6a2331a1..b82abdda4109329cd18b112bc91a2a99513859fe 100644 (file)
@@ -1622,19 +1622,18 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
                only hurts us.  */
             request_remove_header (req, "Authorization");
         }
-    }
-
-  if (sock < 0)
-    {
-      /* In its current implementation, persistent_available_p will
-         look up conn->host in some cases.  If that lookup failed, we
-         don't need to bother with connect_to_host.  */
-      if (host_lookup_failed)
+      else if (host_lookup_failed)
         {
           request_free (req);
+          logprintf(LOG_NOTQUIET,
+                    _("%s: unable to resolve host address `%s'\n"),
+                    exec_name, relevant->host);
           return HOSTERR;
         }
+    }
 
+  if (sock < 0)
+    {
       sock = connect_to_host (conn->host, conn->port);
       if (sock == E_HOST)
         {
@@ -2345,6 +2344,11 @@ http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
       hstat.local_file = xstrdup (opt.output_document);
       got_name = true;
     }
+  else if (!opt.content_disposition)
+    {
+      hstat.local_file = url_file_name (u);
+      got_name = true;
+    }
 
   /* Reset the counter. */
   count = 0;
@@ -2539,7 +2543,7 @@ Remote file does not exist -- broken link!!!\n"));
         }
 
       /* Did we get the time-stamp? */
-      if (send_head_first && !got_head)
+      if (!got_head)
         {
           bool restart_loop = false;