]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Applied contributed patches (see ChangeLog for details.)
[wget] / src / ftp.c
index 61507db4742a26618758cf7c7dc9dbf87ad96ea8..e5a2925e4466bb9b6e483b07dfd8010260a8d129 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -852,9 +852,16 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con)
       /* Increment the pass counter.  */
       ++count;
       /* Wait before the retrieval (unless this is the very first
-        retrieval).  */
-      if (!first_retrieval && opt.wait)
-       sleep (opt.wait);
+        retrieval).
+        Check if we are retrying or not, wait accordingly - HEH */
+      if (!first_retrieval && (opt.wait || (count && opt.waitretry)))
+       if (count)
+         if (count<opt.waitretry)
+           sleep(count);
+         else
+           sleep(opt.waitretry);
+       else
+         sleep (opt.wait);
       if (first_retrieval)
        first_retrieval = 0;
       if (con->st & ON_YOUR_OWN)
@@ -947,6 +954,11 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con)
          /* Not as great.  */
          abort ();
        }
+
+      /* If we get out of the switch above without continue'ing, we've
+        successfully downloaded a file.  Remember this fact. */
+      downloaded_file(ADD_FILE, locf);
+
       if (con->st & ON_YOUR_OWN)
        {
          CLOSE (RBUF_FD (&con->rbuf));
@@ -1086,6 +1098,11 @@ ftp_retrieve_list (struct urlinfo *u, struct fileinfo *f, ccon *con)
       if (opt.timestamping && f->type == FT_PLAINFILE)
        {
          struct stat st;
+         /* If conversion of HTML files retrieved via FTP is ever implemented,
+            we'll need to stat() <file>.orig here when -K has been specified.
+            I'm not implementing it now since files on an FTP server are much
+            more likely than files on an HTTP server to legitimately have a
+            .orig suffix. */
          if (!stat (u->local, &st))
            {
              /* Else, get it from the file.  */
@@ -1094,13 +1111,13 @@ ftp_retrieve_list (struct urlinfo *u, struct fileinfo *f, ccon *con)
              if (local_size == f->size && tml >= f->tstamp)
                {
                  logprintf (LOG_VERBOSE, _("\
-Local file `%s' is more recent, not retrieving.\n\n"), u->local);
+Server file no newer than local file `%s' -- not retrieving.\n\n"), u->local);
                  dlthis = 0;
                }
              else if (local_size != f->size)
                {
                  logprintf (LOG_VERBOSE, _("\
-The sizes do not match (local %ld), retrieving.\n"), local_size);
+The sizes do not match (local %ld) -- retrieving.\n"), local_size);
                }
            }
        }       /* opt.timestamping && f->type == FT_PLAINFILE */