aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-04-02 07:32:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-04-02 07:32:03 +0000
commit7ba4d3464fca05266a9d62ad332658a20fb74ae7 (patch)
tree3696c2cb2c11c4e84875401b7ccec6f89c8e4e40
parent03def138fe1e3a7d199af80f391ea19c51d75dd8 (diff)
Dirk Manske's feedback:
* bring back subsecond resolution to CURLINFO_TOTAL_TIME * Fix the Curl_pgrsDone() so that the final progress update is shown properly
-rw-r--r--lib/progress.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 9a1cef7aa..8c7ef3558 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -117,13 +117,12 @@ static char *max5data(curl_off_t bytes, char *max5)
void Curl_pgrsDone(struct connectdata *conn)
{
struct SessionHandle *data = conn->data;
- if(!(data->progress.flags & PGRS_HIDE)) {
- data->progress.lastshow=0;
- Curl_pgrsUpdate(conn); /* the final (forced) update */
- if(!data->progress.callback)
- /* only output if we don't use progress callback */
- fprintf(data->set.err, "\n");
- }
+ data->progress.lastshow=0;
+ Curl_pgrsUpdate(conn); /* the final (forced) update */
+ if(!(data->progress.flags & PGRS_HIDE) &&
+ !data->progress.callback)
+ /* only output if we don't use a progress callback and we're not hidden */
+ fprintf(data->set.err, "\n");
}
/* reset all times except redirect */
@@ -250,9 +249,8 @@ int Curl_pgrsUpdate(struct connectdata *conn)
now = Curl_tvnow(); /* what time is it */
/* The time spent so far (from the start) */
- timespent = Curl_tvdiff(now, data->progress.start)/1000;
-
- data->progress.timespent = (double)timespent;
+ data->progress.timespent = Curl_tvdiff(now, data->progress.start)/1000.0;
+ timespent = (long)data->progress.timespent;
/* The average download speed this far */
data->progress.dlspeed =