]> sjero.net Git - wget/commitdiff
[svn] Fake a miniscule amount of download time when none is detected.
authorhniksic <devnull@localhost>
Sat, 24 Nov 2001 02:38:47 +0000 (18:38 -0800)
committerhniksic <devnull@localhost>
Sat, 24 Nov 2001 02:38:47 +0000 (18:38 -0800)
src/ChangeLog
src/progress.c

index f71b7b9b8b003f60402cd72cb8242bb2cee8e33e..4fd1e2711922bbd827631460e9f06f514cffc21e 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * progress.c (bar_finish): If the timer didn't record any time
+       since the download beginning, fake 1ms.
+
 2001-11-24  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * recur.c (recursive_retrieve): Fix typo.
index 929aa5604e325559033920439892ca8fbcdcceeb..a69433f903b7e73a6a27d9c543dea19755c46deb 100644 (file)
@@ -439,8 +439,15 @@ static void
 bar_finish (void *progress)
 {
   struct bar_progress *bp = progress;
+  long elapsed = wtimer_elapsed (bp->timer);
 
-  create_image (bp, wtimer_elapsed (bp->timer));
+  if (elapsed == 0)
+    /* If the download was faster than the granularity of the timer,
+       fake some output so that we don't get the ugly "----.--" rate
+       at the download finish.  */
+    elapsed = 1;
+
+  create_image (bp, elapsed);
   display_image (bp->buffer);
 
   logputs (LOG_VERBOSE, "\n\n");