]> sjero.net Git - wget/commitdiff
Move numurls out of options struct.
authorSteven Schubiger <stsc@members.fsf.org>
Sun, 16 Nov 2008 19:53:58 +0000 (20:53 +0100)
committerSteven Schubiger <stsc@members.fsf.org>
Sun, 16 Nov 2008 19:53:58 +0000 (20:53 +0100)
src/ChangeLog
src/ftp.c
src/http.c
src/main.c
src/options.h

index 407ee757812bfee08e1584c864ae3dba29132db6..688b95957a4f1d309cf8f63696b552bcc20edd2f 100644 (file)
@@ -1,3 +1,11 @@
+2008-11-16  Steven Schubiger  <stsc@members.fsf.org>
+
+       * main.c: Declare and initialize the numurls counter.
+
+       * ftp.c, http.c: Make the counter visible here and use it.
+       
+       * options.h: Remove old declaration from options struct.
+
 2008-11-15  Steven Schubiger  <stsc@members.fsf.org>
 
        * init.c (defaults): Set default waitretry value.
index 9f65cc340332957fed6968a2c7fd07b85a14fec5..e4b901899507b1da36b2663c0c89d57973f78b83 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -69,6 +69,7 @@ typedef struct
   struct url *proxy;            /* FTWK-style proxy */
 } ccon;
 
+extern int numurls;
 
 /* Look for regexp "( *[0-9]+ *byte" (literal parenthesis) anywhere in
    the string S, and return the number converted to wgint, if found, 0
@@ -1295,7 +1296,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
                number of bytes and files downloaded. */
             {
               total_downloaded_bytes += len;
-              opt.numurls++;
+              numurls++;
             }
 
           /* Deletion of listing files is not controlled by --delete-after, but
@@ -1310,7 +1311,7 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
              for instance, may want to know how many bytes and files they've
              downloaded through it. */
           total_downloaded_bytes += len;
-          opt.numurls++;
+          numurls++;
 
           if (opt.delete_after)
             {
index 0866f92287bc9a106d2c117e9f9ff05c9ead5a63..9e5074a1197ae3b33b31b6f766285fbef5fec52e 100644 (file)
@@ -142,6 +142,8 @@ struct request {
   int hcount, hcapacity;
 };
 
+extern int numurls;
+
 /* Create a new, empty request.  At least request_set_method must be
    called before the request can be used.  */
 
@@ -2760,7 +2762,7 @@ Remote file exists.\n\n"));
                          number_to_static_string (hstat.contlen),
                          hstat.local_file, count);
             }
-          ++opt.numurls;
+          ++numurls;
           total_downloaded_bytes += hstat.len;
 
           /* Remember that we downloaded the file for later ".orig" code. */
@@ -2788,7 +2790,7 @@ Remote file exists.\n\n"));
                              tms, u->url, number_to_static_string (hstat.len),
                              hstat.local_file, count);
                 }
-              ++opt.numurls;
+              ++numurls;
               total_downloaded_bytes += hstat.len;
 
               /* Remember that we downloaded the file for later ".orig" code. */
index 9bae2d236eeb3441f51d9972cf4b3c33735a409b..02ecb1d68034b224085a4ca97c6903b1ff66bed0 100644 (file)
@@ -80,6 +80,9 @@ static void redirect_output_signal (int);
 #endif
 
 const char *exec_name;
+
+/* Number of successfully downloaded URLs */
+int numurls = 0;
 \f
 #ifndef TESTING
 /* Initialize I18N/L10N.  That amounts to invoking setlocale, and
@@ -1231,7 +1234,7 @@ WARNING: Can't reopen standard output in binary mode;\n\
       logprintf (LOG_NOTQUIET,
                  _("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"),
                  datetime_str (time (NULL)),
-                 opt.numurls,
+                 numurls,
                  human_readable (total_downloaded_bytes),
                  secs_to_human_time (total_download_time),
                  retr_rate (total_downloaded_bytes, total_download_time));
index ba39ec4e967d43c641caf2dfdeac8c112ddedc41..18f031c4aa0508c7915b41e77eb728154bbfdb96 100644 (file)
@@ -124,10 +124,6 @@ struct options
   SUM_SIZE_INT quota;          /* Maximum file size to download and
                                   store. */
 
-  int numurls;                 /* Number of successfully downloaded
-                                  URLs #### should be removed because
-                                  it's not a setting, but a global var */
-
   bool server_response;                /* Do we print server response? */
   bool save_headers;           /* Do we save headers together with
                                   file? */