diff --git a/src/ChangeLog b/src/ChangeLog index 082e3557..a79a290b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-04-23 Hrvoje Niksic + + * retr.c (show_progress): Print the download rate even when the + percentages are not available. + 2001-04-21 Hrvoje Niksic * ftp.c (getftp): Adjust expected_bytes if the length is diff --git a/src/retr.c b/src/retr.c index 3aae5125..1667f52e 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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); }