1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-07 20:59:41 -05:00

calculate upload and download speed using doubles to keep precision.

deleted trailing whitespace
This commit is contained in:
Daniel Stenberg 2004-05-20 20:35:42 +00:00
parent ff52ba7f7b
commit 60f9450594

View File

@ -272,12 +272,14 @@ int Curl_pgrsUpdate(struct connectdata *conn)
timespent = (long)data->progress.timespent; timespent = (long)data->progress.timespent;
/* The average download speed this far */ /* The average download speed this far */
data->progress.dlspeed = data->progress.dlspeed = (curl_off_t)
data->progress.downloaded/(timespent?timespent:1); (data->progress.downloaded/(data->progress.timespent>0?
data->progress.timespent:1));
/* The average upload speed this far */ /* The average upload speed this far */
data->progress.ulspeed = data->progress.ulspeed = (curl_off_t)
data->progress.uploaded/(timespent?timespent:1); (data->progress.uploaded/(data->progress.timespent>0?
data->progress.timespent:1));
if(data->progress.lastshow == Curl_tvlong(now)) if(data->progress.lastshow == Curl_tvlong(now))
return 0; /* never update this more than once a second if the end isn't return 0; /* never update this more than once a second if the end isn't