* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, 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
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
#include "memdebug.h" /* keep this as LAST include */
/*
-** callback for CURLOPT_PROGRESSFUNCTION
+** callback for CURLOPT_XFERINFOFUNCTION
*/
#define MAX_BARLENGTH 256
int tool_progress_cb(void *clientp,
- double dltotal, double dlnow,
- double ultotal, double ulnow)
+ curl_off_t dltotal, curl_off_t dlnow,
+ curl_off_t ultotal, curl_off_t ulnow)
{
/* The original progress-bar source code was written for curl by Lars Aas,
and this new edition inherits some of his concepts. */
curl_off_t total;
curl_off_t point;
- if(bar->calls && (tvdiff(now, bar->prevtime) < 200L))
- /* after first call, limit progress-bar updating to 5 Hz */
- return 0;
-
/* expected transfer size */
- total = (curl_off_t)dltotal + (curl_off_t)ultotal + bar->initial_size;
+ total = dltotal + ultotal + bar->initial_size;
/* we've come this far */
- point = (curl_off_t)dlnow + (curl_off_t)ulnow + bar->initial_size;
+ point = dlnow + ulnow + bar->initial_size;
+
+ if(bar->calls && (tvdiff(now, bar->prevtime) < 100L) && point < total)
+ /* after first call, limit progress-bar updating to 10 Hz */
+ /* update when we're at 100% even if last update is less than 200ms ago */
+ return 0;
if(point > total)
/* we have got more than the expected total! */
}
void progressbarinit(struct ProgressData *bar,
- struct Configurable *config)
+ struct OperationConfig *config)
{
#ifdef __EMX__
/* 20000318 mgs */
bar->width = scr_size[0] - 1;
#endif
- bar->out = config->errors;
+ bar->out = config->global->errors;
}
-