mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-03 02:41:53 -05:00
Don't initialize progress to zero before calling curl_easy_perform().
Drawing progress bars before calling curl_easy_perform() is needless as the curl progress callback is called with zero progress before actually downloading the file anyways. Fixes display of "0%" progress bars when sync'ing package databases that are already up to date. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
488f341f57
commit
c67c864ffd
@ -214,10 +214,9 @@ static int curl_download_internal(const char *url, const char *localpath,
|
|||||||
sigaction(SIGINT, NULL, &sig_int[OLD]);
|
sigaction(SIGINT, NULL, &sig_int[OLD]);
|
||||||
sigaction(SIGINT, &sig_int[NEW], NULL);
|
sigaction(SIGINT, &sig_int[NEW], NULL);
|
||||||
|
|
||||||
/* Progress 0 - initialize */
|
/* set initial value of prevprogress to -1 which causes curl_progress() to
|
||||||
if(handle->dlcb) {
|
* initialize the progress bar with 0% once. */
|
||||||
handle->dlcb(filename, 0, 1);
|
prevprogress = -1;
|
||||||
}
|
|
||||||
|
|
||||||
/* perform transfer */
|
/* perform transfer */
|
||||||
handle->curlerr = curl_easy_perform(handle->curl);
|
handle->curlerr = curl_easy_perform(handle->curl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user