mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
-# progress meter: avoid superfluous updates and duplicate lines
By comparing if a different "progress point" is reached or not since the previous update, the progress function callback for this now avoids many superfluous screen updates. This has the nice side-effect that it fixes a problem that causes a second progress meter line. The second line output happened because when we use the -# progress meter, we force a newline output after the transfer in the main loop in curl, but when libcurl calls the progress callback from curl_easy_cleanup() it would then output the progress display again. Possibly the naive newline output is wrong but this optimization was suitable anyway... Reported by: Daniel Theron Bug: http://curl.haxx.se/bug/view.cgi?id=3517418
This commit is contained in:
parent
a498daa0e0
commit
4d28a59fc2
@ -76,7 +76,7 @@ int tool_progress_cb(void *clientp,
|
|||||||
prevblock++;
|
prevblock++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if(point != bar->prev) {
|
||||||
frac = (double)point / (double)total;
|
frac = (double)point / (double)total;
|
||||||
percent = frac * 100.0f;
|
percent = frac * 100.0f;
|
||||||
barwidth = bar->width - 7;
|
barwidth = bar->width - 7;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user