diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2013-07-31 09:06:15 +0200 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2013-07-31 13:41:00 +0200 | 
| commit | 5af2bfb9557e36a5e9ad181f7b5edc3d1875e8bc (patch) | |
| tree | 1e5ee5d97bb7097f8e1ee0bebd811f43269b8b01 /src | |
| parent | 1691a31cab33ef1d6a186bd08e5f8cf7661e34c1 (diff) | |
curl: --progress-bar max update frequency now at 5Hz
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.inc | 3 | ||||
| -rw-r--r-- | src/tool_cb_prg.c | 4 | ||||
| -rw-r--r-- | src/tool_cb_prg.h | 2 | 
3 files changed, 5 insertions, 4 deletions
| diff --git a/src/Makefile.inc b/src/Makefile.inc index cd890accc..09bd9e804 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -13,7 +13,8 @@ CURLX_ONES = \  	../lib/strtoofft.c \  	../lib/strdup.c \  	../lib/rawstr.c \ -	../lib/nonblock.c +	../lib/nonblock.c \ +	../lib/timeval.c  CURL_CFILES = \  	tool_binmode.c \ diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index 9facd9e76..b94442be8 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -49,12 +49,12 @@ int tool_progress_cb(void *clientp,    double percent;    int barwidth;    int num; -  time_t now = time(NULL); +  struct timeval now = curlx_tvnow();    struct ProgressData *bar = (struct ProgressData *)clientp;    curl_off_t total;    curl_off_t point; -  if(bar->prevtime == now) /* wait with update */ +  if(curlx_tvdiff(now, bar->prevtime) < 200) /* allow 5 Hz */      return 0;    /* expected transfer size */ diff --git a/src/tool_cb_prg.h b/src/tool_cb_prg.h index ceb85980c..a20645e86 100644 --- a/src/tool_cb_prg.h +++ b/src/tool_cb_prg.h @@ -29,7 +29,7 @@  struct ProgressData {    int         calls;    curl_off_t  prev; -  time_t      prevtime; +  struct timeval prevtime;    int         width;    FILE       *out;  /* where to write everything to */    curl_off_t  initial_size; | 
