From a304051620b92e12b6b1b4e19edc57b34ea332b6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 18 Jan 2021 11:56:50 +0100 Subject: lib: more conn->data cleanups Closes #6479 --- lib/progress.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lib/progress.c') diff --git a/lib/progress.c b/lib/progress.c index 658d05ab8..55e8ded04 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, , 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; -- cgit v1.2.1