diff options
author | Brad King <brad.king@kitware.com> | 2021-02-03 11:55:06 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-03 11:55:06 -0500 |
commit | 426ef61cc8d850ad6877d0598a9917ce9a4f2b20 (patch) | |
tree | 139e0e0af11012c1cd5e9c89d90305bf6d68e916 /Utilities/cmcurl/lib/progress.c | |
parent | 0341888c006c19d0057017231ed43279d53e6034 (diff) | |
parent | 076b3219f58ca16afa52fe095019a05537ade0f3 (diff) | |
download | cmake-426ef61cc8d850ad6877d0598a9917ce9a4f2b20.tar.gz |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2021-02-03 (2f33be81)
Diffstat (limited to 'Utilities/cmcurl/lib/progress.c')
-rw-r--r-- | Utilities/cmcurl/lib/progress.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Utilities/cmcurl/lib/progress.c b/Utilities/cmcurl/lib/progress.c index 658d05ab8e..55e8ded04d 100644 --- a/Utilities/cmcurl/lib/progress.c +++ b/Utilities/cmcurl/lib/progress.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -137,12 +137,11 @@ static char *max5data(curl_off_t bytes, char *max5) */ -int Curl_pgrsDone(struct connectdata *conn) +int Curl_pgrsDone(struct Curl_easy *data) { int rc; - struct Curl_easy *data = conn->data; data->progress.lastshow = 0; - rc = Curl_pgrsUpdate(conn); /* the final (forced) update */ + rc = Curl_pgrsUpdate(data); /* the final (forced) update */ if(rc) return rc; @@ -371,11 +370,10 @@ void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size) } /* returns TRUE if it's time to show the progress meter */ -static bool progress_calc(struct connectdata *conn, struct curltime now) +static bool progress_calc(struct Curl_easy *data, struct curltime now) { curl_off_t timespent; curl_off_t timespent_ms; /* milliseconds */ - struct Curl_easy *data = conn->data; curl_off_t dl = data->progress.downloaded; curl_off_t ul = data->progress.uploaded; bool timetoshow = FALSE; @@ -465,9 +463,8 @@ static bool progress_calc(struct connectdata *conn, struct curltime now) } #ifndef CURL_DISABLE_PROGRESS_METER -static void progress_meter(struct connectdata *conn) +static void progress_meter(struct Curl_easy *data) { - struct Curl_easy *data = conn->data; char max5[6][10]; curl_off_t dlpercen = 0; curl_off_t ulpercen = 0; @@ -581,11 +578,10 @@ static void progress_meter(struct connectdata *conn) * Curl_pgrsUpdate() returns 0 for success or the value returned by the * progress callback! */ -int Curl_pgrsUpdate(struct connectdata *conn) +int Curl_pgrsUpdate(struct Curl_easy *data) { - struct Curl_easy *data = conn->data; struct curltime now = Curl_now(); /* what time is it */ - bool showprogress = progress_calc(conn, now); + bool showprogress = progress_calc(data, now); if(!(data->progress.flags & PGRS_HIDE)) { if(data->set.fxferinfo) { int result; @@ -621,7 +617,7 @@ int Curl_pgrsUpdate(struct connectdata *conn) } if(showprogress) - progress_meter(conn); + progress_meter(data); } return 0; |