aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-04-18 20:02:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-04-18 20:02:41 +0000
commit8e719e3ef5ad90b7f8ad9c82a853df1afb23afd7 (patch)
tree8351599be56a88427956a1e2abee913fd3867d53 /lib
parent66fc5498d2a50dd7f32cd21487252de1dd834dda (diff)
- Prevent the internal progress meter from updating more frequently than once
per second.
Diffstat (limited to 'lib')
-rw-r--r--lib/progress.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 9d9096069..ad09938f8 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -245,6 +245,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
long ulestimate=0;
long dlestimate=0;
long total_estimate;
+ bool shownow=FALSE;
now = Curl_tvnow(); /* what time is it */
@@ -266,6 +267,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
/* Calculations done at most once a second, unless end is reached */
if(data->progress.lastshow != (long)now.tv_sec) {
+ shownow = TRUE;
data->progress.lastshow = now.tv_sec;
@@ -346,7 +348,12 @@ int Curl_pgrsUpdate(struct connectdata *conn)
return result;
}
- /* If there's no external callback set, use internal code to show progress */
+ if(!shownow)
+ /* only show the internal progress meter once per second */
+ return 0;
+
+ /* If there's no external callback set, use internal code to show
+ progress */
if(!(data->progress.flags & PGRS_HEADERS_OUT)) {
if(data->reqdata.resume_from) {
@@ -422,7 +429,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
/* we flush the output stream to make it appear as soon as possible */
fflush(data->set.err);
- }
+ } /* !(data->progress.flags & PGRS_HIDE) */
return 0;
}