summaryrefslogtreecommitdiffstats
path: root/lib/progress.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2021-02-03 07:02:36 (GMT)
committerBrad King <brad.king@kitware.com>2021-02-03 16:49:32 (GMT)
commit076b3219f58ca16afa52fe095019a05537ade0f3 (patch)
treef9ea493f94ce5afb8792e1ab4a040cea7eba4aed /lib/progress.c
parent5aacc593a961fe9ee1427c03d18fba8947a9e33d (diff)
downloadCMake-076b3219f58ca16afa52fe095019a05537ade0f3.zip
CMake-076b3219f58ca16afa52fe095019a05537ade0f3.tar.gz
CMake-076b3219f58ca16afa52fe095019a05537ade0f3.tar.bz2
curl 2021-02-03 (2f33be81)
Code extracted from: https://github.com/curl/curl.git at commit 2f33be817cbce6ad7a36f27dd7ada9219f13584c (curl-7_75_0).
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 658d05a..55e8ded 100644
--- a/lib/progress.c
+++ b/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;