download : disable progressbar when total is unknown.

This is a work around for FS#8725.

There are some bad combination of proxies and mirrors where the Content
Length is not returned, and thus the progress bar can't be displayed
correctly.

Dan: Note that this patch also adds a "downloading" message when the
progress bar is disabled, which was formerly not indicated at all in the
output.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2008-08-20 23:17:02 +02:00 committed by Dan McGee
parent 081f64aea3
commit e760c4f478
1 changed files with 4 additions and 1 deletions

View File

@ -444,7 +444,10 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
int file_percent = 0, total_percent = 0;
char rate_size = 'K', xfered_size = 'K';
if(config->noprogressbar) {
if(config->noprogressbar || file_total == -1) {
if(file_xfered == 0) {
printf(_("downloading %s...\n"), filename);
}
return;
}