mirror of
https://github.com/curl/curl.git
synced 2026-08-25 18:33:42 +03:00
parent
bbe3aa9f88
commit
a304051620
30 changed files with 572 additions and 574 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue