cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Download Averaging Issue

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 23 Nov 2011 00:07:17 +0100 (CET)

On Sun, 20 Nov 2011, Rob Ward wrote:

> With regards to resetting a timer/data the only way I can see of doing this
> without effecting the current behaviour of curl is to add a reset option
> that would store the current downloaded amount and download time that can be
> used as an offset within the calculations for the current average.

If we want to keep the current behavior exactly, then we can of course not
modify it at all but would require a new option.

Another way than introducing such offsets you mention could be to simply add a
new internal speed counter that would be used for this and that can be reset
without it affecting everything else. Or we just reset the 5 second average
counter to the set value and live with the possible side-effects.

Right now I'm a bit torn about what the best possible approach would be...

> The other solution that appears relatively simple and as far as I can see
> would have little impact on any other code is to have another option that
> specifies a minimum desired download rate, then where the average speed is
> used to decide if a delay should be inserted before downloading more data
> this can be checked, and if the current rate is below it will continue
> without delay irrespective of the average speed calculations.

Right. It has the upside that it doesn't change any old behaviour, but it has
the downside that it adds a new option and a new option that basically only
makes sense exactly for the very limited use case when you set/lower the rate
limit during a transfer.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-23