]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Fix -O timestamp bug.
[wget] / src / http.c
index e3411874370e4d4bebb2ff5a89edfd3996996c87..676fef5b7db4a0845d5b7a75380e1aab58ede452 100644 (file)
@@ -44,10 +44,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # endif
 #endif
 
-#ifdef HAVE_SSL
-#include "gen_sslfunc.h"
-#endif /* HAVE_SSL */
-
 #ifdef WINDOWS
 # include <winsock.h>
 #endif
@@ -65,6 +61,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #if USE_DIGEST
 # include "md5.h"
 #endif
+#ifdef HAVE_SSL
+# include "gen_sslfunc.h"
+#endif /* HAVE_SSL */
 
 extern char *version_string;
 
@@ -365,7 +364,7 @@ register_persistent (const char *host, unsigned short port, int fd
 static int
 persistent_available_p (const char *host, unsigned short port
 #ifdef HAVE_SSL
-                       int ssl
+                       int ssl
 #endif
                        )
 {
@@ -1527,15 +1526,25 @@ The sizes do not match (local %ld) -- retrieving.\n"), local_size);
          FREEHSTAT (hstat);
          continue;
        }
-      if (!opt.dfp
-         && (tmr != (time_t) (-1))
+      if ((tmr != (time_t) (-1))
          && !opt.spider
          && ((hstat.len == hstat.contlen) ||
              ((hstat.res == 0) &&
               ((hstat.contlen == -1) ||
                (hstat.len >= hstat.contlen && !opt.kill_longer)))))
        {
-         touch (u->local, tmr);
+         /* #### This code repeats in http.c and ftp.c.  Move it to a
+             function!  */
+         const char *fl = NULL;
+         if (opt.output_document)
+           {
+             if (opt.od_known_regular)
+               fl = opt.output_document;
+           }
+         else
+           fl = u->local;
+         if (fl)
+           touch (fl, tmr);
        }
       /* End of time-stamping section.  */