mirror of
https://github.com/mirror/wget.git
synced 2025-02-01 23:30:11 +08:00
[svn] Print download rate even when percentages are not available.
Published in <sxs1yqjd4ct.fsf@florida.arsdigita.de>.
This commit is contained in:
parent
38120f75ef
commit
6ba7711d6a
@ -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>
|
2001-04-21 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* ftp.c (getftp): Adjust expected_bytes if the length is
|
* ftp.c (getftp): Adjust expected_bytes if the length is
|
||||||
|
46
src/retr.c
46
src/retr.c
@ -183,27 +183,25 @@ show_progress (long res, long expected, enum spflags flags)
|
|||||||
|
|
||||||
if (flags == SP_FINISH)
|
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;
|
if (!(dot % opt.dot_spacing))
|
||||||
char *tmpstr = (char *)alloca (2 * opt.dots_in_line + 1);
|
*tmpp++ = ' ';
|
||||||
char *tmpp = tmpstr;
|
*tmpp++ = ' ';
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
|
*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");
|
logputs (LOG_VERBOSE, "\n\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -255,12 +253,10 @@ show_progress (long res, long expected, enum spflags flags)
|
|||||||
ndot = 0;
|
ndot = 0;
|
||||||
++nrow;
|
++nrow;
|
||||||
if (expected)
|
if (expected)
|
||||||
{
|
print_percentage (nrow * line_bytes, expected);
|
||||||
print_percentage (nrow * line_bytes, expected);
|
logprintf (LOG_VERBOSE, " @%s",
|
||||||
logprintf (LOG_VERBOSE, " @%s",
|
rate (line_bytes - (initial_skip % line_bytes),
|
||||||
rate (line_bytes - (initial_skip % line_bytes),
|
time_offset, 1));
|
||||||
time_offset, 1));
|
|
||||||
}
|
|
||||||
initial_skip = 0;
|
initial_skip = 0;
|
||||||
logprintf (LOG_VERBOSE, "\n%5ldK", nrow * line_bytes / 1024);
|
logprintf (LOG_VERBOSE, "\n%5ldK", nrow * line_bytes / 1024);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user