]> sjero.net Git - wget/commitdiff
Automated merge with file:/home/micah/devel/wget/fix-double-gets
authorMicah Cowan <micah@cowan.name>
Tue, 9 Oct 2007 07:14:33 +0000 (00:14 -0700)
committerMicah Cowan <micah@cowan.name>
Tue, 9 Oct 2007 07:14:33 +0000 (00:14 -0700)
src/ChangeLog
src/http.c

index 6864760e1496df4447ca995b7b7c44b913cf6cd0..f3b0e539d18d3f889a9a22ac2ce6732b25944c00 100644 (file)
@@ -1,10 +1,10 @@
-2007-10-02  Gisle Vanem  <gvanem@broadpark.no>
-       
-       * ftp.c: Use "_listing" for MSDOS (".listing" is illegal).
+2007-10-08  Micah Cowan  <micah@cowan.name>
 
-       * url.c: Update comment for 'filechr_not_windows'.
-
-       * utils.c: Include <process.h> for 'getpid()' on Watcom.
+       * http.c (http_loop): Add send_head_first conditional back
+       around code that needs it, but not around the last-modified
+       header-parsing stuff this time. Removed no-longer-useful (was it
+       ever?) restart_loop boolean, continuing unconditionally at end
+       of send_head_first conditional block (if we haven't jumped out).
 
 2007-10-04  Micah Cowan  <micah@cowan.name>
 
        support isn't on; make sure we continue properly in that case,
        even though we're not sending HEAD.
 
+2007-10-02  Gisle Vanem  <gvanem@broadpark.no>
+       
+       * ftp.c: Use "_listing" for MSDOS (".listing" is illegal).
+
+       * url.c: Update comment for 'filechr_not_windows'.
+
+       * utils.c: Include <process.h> for 'getpid()' on Watcom.
+
 2007-10-02  Micah Cowan  <micah@cowan.name>
 
        * ftp.c (getftp, ftp_loop_internal), http.c (http_loop), main
index b82abdda4109329cd18b112bc91a2a99513859fe..67e9a989eae93fddfae02cdb73db16fb06656c74 100644 (file)
@@ -2545,7 +2545,7 @@ Remote file does not exist -- broken link!!!\n"));
       /* Did we get the time-stamp? */
       if (!got_head)
         {
-          bool restart_loop = false;
+          got_head = true;    /* no more time-stamping */
 
           if (opt.timestamping && !hstat.remote_time)
             {
@@ -2563,92 +2563,87 @@ Last-modified header invalid -- time-stamp ignored.\n"));
                 time_came_from_head = true;
             }
       
-          /* The time-stamping section.  */
-          if (opt.timestamping)
+          if (send_head_first)
             {
-              if (hstat.orig_file_name) /* Perform the following checks only 
-                                           if the file we're supposed to 
-                                           download already exists. */
+              /* The time-stamping section.  */
+              if (opt.timestamping)
                 {
-                  if (hstat.remote_time && 
-                      tmr != (time_t) (-1))
+                  if (hstat.orig_file_name) /* Perform the following
+                                               checks only if the file
+                                               we're supposed to
+                                               download already exists.  */
                     {
-                      /* Now time-stamping can be used validly.  Time-stamping
-                         means that if the sizes of the local and remote file
-                         match, and local file is newer than the remote file,
-                         it will not be retrieved.  Otherwise, the normal
-                         download procedure is resumed.  */
-                      if (hstat.orig_file_tstamp >= tmr)
+                      if (hstat.remote_time && 
+                          tmr != (time_t) (-1))
                         {
-                          if (hstat.contlen == -1 
-                              || hstat.orig_file_size == hstat.contlen)
+                          /* Now time-stamping can be used validly.
+                             Time-stamping means that if the sizes of
+                             the local and remote file match, and local
+                             file is newer than the remote file, it will
+                             not be retrieved.  Otherwise, the normal
+                             download procedure is resumed.  */
+                          if (hstat.orig_file_tstamp >= tmr)
                             {
-                              logprintf (LOG_VERBOSE, _("\
+                              if (hstat.contlen == -1 
+                                  || hstat.orig_file_size == hstat.contlen)
+                                {
+                                  logprintf (LOG_VERBOSE, _("\
 Server file no newer than local file `%s' -- not retrieving.\n\n"),
-                                         hstat.orig_file_name);
-                              ret = RETROK;
-                              goto exit;
-                            }
-                          else
-                            {
-                              logprintf (LOG_VERBOSE, _("\
+                                             hstat.orig_file_name);
+                                  ret = RETROK;
+                                  goto exit;
+                                }
+                              else
+                                {
+                                  logprintf (LOG_VERBOSE, _("\
 The sizes do not match (local %s) -- retrieving.\n"),
-                                         number_to_static_string (hstat.orig_file_size));
+                                             number_to_static_string (hstat.orig_file_size));
+                                }
                             }
-                        }
-                      else
-                        logputs (LOG_VERBOSE,
-                                 _("Remote file is newer, retrieving.\n"));
+                          else
+                            logputs (LOG_VERBOSE,
+                                     _("Remote file is newer, retrieving.\n"));
 
-                      logputs (LOG_VERBOSE, "\n");
+                          logputs (LOG_VERBOSE, "\n");
+                        }
                     }
+                  
+                  /* free_hstat (&hstat); */
+                  hstat.timestamp_checked = true;
                 }
               
-              /* free_hstat (&hstat); */
-              hstat.timestamp_checked = true;
-              restart_loop = true;
-            }
-          
-          if (opt.spider)
-            {
-              if (opt.recursive)
+              if (opt.spider)
                 {
-                  if (*dt & TEXTHTML)
+                  if (opt.recursive)
                     {
-                      logputs (LOG_VERBOSE, _("\
+                      if (*dt & TEXTHTML)
+                        {
+                          logputs (LOG_VERBOSE, _("\
 Remote file exists and could contain links to other resources -- retrieving.\n\n"));
-                      restart_loop = true;
+                        }
+                      else 
+                        {
+                          logprintf (LOG_VERBOSE, _("\
+Remote file exists but does not contain any link -- not retrieving.\n\n"));
+                          ret = RETROK; /* RETRUNNEEDED is not for caller. */
+                          goto exit;
+                        }
                     }
-                  else 
+                  else
                     {
                       logprintf (LOG_VERBOSE, _("\
-Remote file exists but does not contain any link -- not retrieving.\n\n"));
+Remote file exists but recursion is disabled -- not retrieving.\n\n"));
                       ret = RETROK; /* RETRUNNEEDED is not for caller. */
                       goto exit;
                     }
                 }
-              else
-                {
-                  logprintf (LOG_VERBOSE, _("\
-Remote file exists but recursion is disabled -- not retrieving.\n\n"));
-                  ret = RETROK; /* RETRUNNEEDED is not for caller. */
-                  goto exit;
-                }
-            }
 
-          if (send_head_first)
-            {
               got_name = true;
-              restart_loop = true;
-            }
-          
-          got_head = true;    /* no more time-stamping */
-          *dt &= ~HEAD_ONLY;
-          count = 0;          /* the retrieve count for HEAD is reset */
-
-          if (restart_loop) 
-            continue;
-        }
+              *dt &= ~HEAD_ONLY;
+              count = 0;          /* the retrieve count for HEAD is reset */
+              continue;
+            } /* send_head_first */
+        } /* !got_head */
           
       if ((tmr != (time_t) (-1))
           && ((hstat.len == hstat.contlen) ||