cURL / Mailing Lists / curl-library / Single Mail

curl-library

Download Averaging Issue

From: Rob Ward <rob_at_rob-ward.co.uk>
Date: Wed, 16 Nov 2011 12:04:30 +0000

Hi All,

I am currently implementing an application using curl that needs to
download data at a given maximum rate, this rate however varies depending
of other factors(This is for video streaming and I have to meet a spec not
in my control). In order to do this I have being using the
CURLOPT_MAX_RECV_SPEED_LARGE
option. Unfortunately an issue has being found where the download seems to
be paused for a number of seconds. This appears to be caused due to the
fact that under certain circumstances the download rate is set to a very
high value(usually at the start of if it runs out of video) in order to get
more data as fast as possible, when a certain amount of data is received
the max speed is once again set down to a lower limit. I believe that this
is causing an issues as the download max rate uses the average from the
transaction(including the high speed area) in its calculation. As such the
transfer halts until the average is brought down to the current
maximum(which can be several seconds).

Firstly I would like to know if that sounds correct? I'm relatively new to
the internals of curl so may have missed some code.

If this is the case is there any know way of getting round this already
implemented, I have never seen one and couldn't find one in the
documentation but doesn't mean I have missed it.

If this does seem plausible and there is no current way of handling this
then I can see two potential solutions that could be added(they seem to be
possible from my understanding of curl code). The first being to add a
CURLOPT_MIN_RECV_SPEED_LARGE
that can be used to define a Minimum download speed that is used in
preference to the average. The alternative might be to add a
CURLOPT_RESET_RECV_AVG_SPEED.

If one of these solutions were to be needed then my preference would be for
the first one as it would seem to have more uses than just reseting the
average, obviously with either of these solutions the matching uploads
would also have to be done.

Regards,

Rob Ward

-- 
------------------------------
Rob Ward
www.rob-ward.co.uk

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