]> sjero.net Git - wget/commitdiff
[svn] Print download rate even when percentages are not available.
authorhniksic <devnull@localhost>
Mon, 23 Apr 2001 15:28:34 +0000 (08:28 -0700)
committerhniksic <devnull@localhost>
Mon, 23 Apr 2001 15:28:34 +0000 (08:28 -0700)
Published in <sxs1yqjd4ct.fsf@florida.arsdigita.de>.

src/ChangeLog
src/retr.c

index 082e3557b6ebf0fbc792954cb09841c51a397cfe..a79a290b71f237f96b0e922f9a0da526d75dcba3 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-23  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * retr.c (show_progress): Print the download rate even when the
+       percentages are not available.
+
 2001-04-21  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * ftp.c (getftp): Adjust expected_bytes if the length is
index 3aae5125324a10b1519e015f8828c0debcb06f63..1667f52e0c7d589b5d262974dc9c1e567f101b47 100644 (file)
@@ -183,27 +183,25 @@ show_progress (long res, long expected, enum spflags flags)
 
   if (flags == SP_FINISH)
     {
-      if (expected)
+      int dot = ndot;
+      char *tmpstr = (char *)alloca (2 * opt.dots_in_line + 1);
+      char *tmpp = tmpstr;
+      time_offset = elapsed_time () - last_timer;
+      for (; dot < opt.dots_in_line; dot++)
        {
-         int dot = ndot;
-         char *tmpstr = (char *)alloca (2 * opt.dots_in_line + 1);
-         char *tmpp = tmpstr;
-         time_offset = elapsed_time () - last_timer;
-         for (; dot < opt.dots_in_line; dot++)
-           {
-             if (!(dot % opt.dot_spacing))
-               *tmpp++ = ' ';
-             *tmpp++ = ' ';
-           }
-         *tmpp = '\0';
-         logputs (LOG_VERBOSE, tmpstr);
-         print_percentage (nrow * line_bytes + ndot * opt.dot_bytes + offs,
-                           expected);
-         logprintf (LOG_VERBOSE, " @%s",
-                    rate (ndot * opt.dot_bytes
-                          + offs - (initial_skip % line_bytes),
-                          time_offset, 1));
+         if (!(dot % opt.dot_spacing))
+           *tmpp++ = ' ';
+         *tmpp++ = ' ';
        }
+      *tmpp = '\0';
+      logputs (LOG_VERBOSE, tmpstr);
+      if (expected)
+       print_percentage (nrow * line_bytes + ndot * opt.dot_bytes + offs,
+                         expected);
+      logprintf (LOG_VERBOSE, " @%s",
+                rate (ndot * opt.dot_bytes
+                      + offs - (initial_skip % line_bytes),
+                      time_offset, 1));
       logputs (LOG_VERBOSE, "\n\n");
       return 0;
     }
@@ -255,12 +253,10 @@ show_progress (long res, long expected, enum spflags flags)
          ndot = 0;
          ++nrow;
          if (expected)
-           {
-             print_percentage (nrow * line_bytes, expected);
-             logprintf (LOG_VERBOSE, " @%s",
-                        rate (line_bytes - (initial_skip % line_bytes),
-                              time_offset, 1));
-           }
+           print_percentage (nrow * line_bytes, expected);
+         logprintf (LOG_VERBOSE, " @%s",
+                    rate (line_bytes - (initial_skip % line_bytes),
+                          time_offset, 1));
          initial_skip = 0;
          logprintf (LOG_VERBOSE, "\n%5ldK", nrow * line_bytes / 1024);
        }