aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-08-10 06:24:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-08-10 06:24:49 +0000
commit4b6c2408327d283a1453c8540367fd00285e5862 (patch)
treefbbf25c76693c6a1fb26b980d340f37977064901 /lib
parent022ea4226528d97f2de929c54b24e90ac4a99d42 (diff)
moved the download/upload speed calculations, to be made on every invoke
of the progressupdate, as on very quick transfers they wouldn't always get calculated!
Diffstat (limited to 'lib')
-rw-r--r--lib/progress.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 08d9c7890..af756a026 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -225,20 +225,19 @@ int Curl_pgrsUpdate(struct connectdata *conn)
/* The exact time spent so far */
data->progress.timespent = Curl_tvdiff (now, data->progress.start);
- if(data->progress.lastshow == Curl_tvlong(now))
- return 0; /* never update this more than once a second if the end isn't
- reached */
- data->progress.lastshow = now.tv_sec;
-
/* The average download speed this far */
data->progress.dlspeed = data->progress.downloaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
/* The average upload speed this far */
data->progress.ulspeed = data->progress.uploaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
+ if(data->progress.lastshow == Curl_tvlong(now))
+ return 0; /* never update this more than once a second if the end isn't
+ reached */
+ data->progress.lastshow = now.tv_sec;
+
/* Let's do the "current speed" thing, which should use the fastest
of the dl/ul speeds */
-
data->progress.speeder[ nowindex ] =
data->progress.downloaded>data->progress.uploaded?
data->progress.downloaded:data->progress.uploaded;