Commit 60f94505 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

calculate upload and download speed using doubles to keep precision.

deleted trailing whitespace
parent ff52ba7f
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -272,12 +272,14 @@ int Curl_pgrsUpdate(struct connectdata *conn)
  timespent = (long)data->progress.timespent;

  /* The average download speed this far */
  data->progress.dlspeed =
    data->progress.downloaded/(timespent?timespent:1);
  data->progress.dlspeed = (curl_off_t)
    (data->progress.downloaded/(data->progress.timespent>0?
                               data->progress.timespent:1));

  /* The average upload speed this far */
  data->progress.ulspeed =
    data->progress.uploaded/(timespent?timespent:1);
  data->progress.ulspeed = (curl_off_t)
    (data->progress.uploaded/(data->progress.timespent>0?
                              data->progress.timespent:1));

  if(data->progress.lastshow == Curl_tvlong(now))
    return 0; /* never update this more than once a second if the end isn't