[svn] Fake a miniscule amount of download time when none is detected.

This commit is contained in:
hniksic 2001-11-23 18:38:47 -08:00
parent 1da2947d50
commit 212eb1ddaf
2 changed files with 13 additions and 1 deletions

View 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.

View 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");