cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Download Averaging Issue

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 19 Nov 2011 22:45:46 +0100 (CET)

On Fri, 18 Nov 2011, Rob Ward wrote:

> I saw that curl was stored the data of the average for the last 5 seconds
> and looked at using this as a potential solution. However if the download
> speed was 10meg (max out the connection) and after this point the max speed
> was set to 1meg then it would be 6 seconds(if I did my maths right) before
> the download would resume

Right, but I think it is mostly a matter of understanding and documenting the
behavior and adjusting your code to that.

If you get 10/sec and suddently sets max transfer rate down to 1/sec, at that
moment you should have roughly 9 too many for that second and it would take
about 9 seconds until you need more data again. I don't think that is a
completely wrong way to see it.

I figure you mean that when you set the new rate to 1/sec you should get 1
data during following second, disregarding what was delivered the previous
second. To make that work, I figure either an internal timer or data count
need to be reset when you change the value.

Or did I misunderstand ?

-- 
  / 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-19