summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-06-09 11:16:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-06-09 11:16:18 +0200
commitd58800a9e73f39e79919c7cf68bcd66ba95e992d (patch)
tree9f794b444aa82cc1af60d67848e1d77d99295b73
parentb94a2cdfe641a9094a2352f3f38b02ead3ffe8d5 (diff)
downloadcurl-bagder/current-speed-the-fastest.tar.gz
progress: let "current speed" be UL + DL speeds combinedbagder/current-speed-the-fastest
Bug #1556 Reported-by: Paul Harris
-rw-r--r--lib/progress.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/progress.c b/lib/progress.c
index cfaf4049e..a382d1a90 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -380,11 +380,10 @@ int Curl_pgrsUpdate(struct connectdata *conn)
data->progress.lastshow = now.tv_sec;
- /* Let's do the "current speed" thing, which should use the fastest
- of the dl/ul speeds. Store the faster speed at entry 'nowindex'. */
+ /* Let's do the "current speed" thing, with the dl + ul speeds
+ combined. Store the speed at entry 'nowindex'. */
data->progress.speeder[ nowindex ] =
- data->progress.downloaded>data->progress.uploaded?
- data->progress.downloaded:data->progress.uploaded;
+ data->progress.downloaded + data->progress.uploaded;
/* remember the exact time for this moment */
data->progress.speeder_time [ nowindex ] = now;
@@ -433,10 +432,9 @@ int Curl_pgrsUpdate(struct connectdata *conn)
}
}
else
- /* the first second we use the main average */
+ /* the first second we use the average */
data->progress.current_speed =
- (data->progress.ulspeed>data->progress.dlspeed)?
- data->progress.ulspeed:data->progress.dlspeed;
+ data->progress.ulspeed + data->progress.dlspeed;
} /* Calculations end */