cURL / Mailing Lists / curl-library / Single Mail

curl-library

Changing CURLOPT_MAX_RECV_SPEED_LARGE during a transfer

From: Robert Foreman <robert.foreman_at_rd.bbc.co.uk>
Date: Fri, 31 Aug 2012 16:38:54 +0100

Hello,

I'm trying to limit the download speed of a transfer, but only once the
file is partly downloaded. I've done this by using the PROGRESSFUNCTION
callback, in which I wait until (say) 10% of the file is downloaded and
then call CURLOPT_MAX_RECV_SPEED_LARGE to set a rate limit.

It appears to work, but I'd like to know whether this is reliable or
whether it might break on another system.

The second thing I'd like to do is be able to change the rate limit at
regular intervals while the transfer is in progress. The obvious way
would be to have a second thread that calls CURLOPT_MAX_RECV_SPEED_LARGE
at regular intervals, but I can't do that without sharing the curl
handle between threads. Is there a way to do this?

Many thanks,

Rob Foreman

-- 
Rob Foreman
BBC Research & Development
D221 Centre House, 56 Wood Lane, LONDON W12 7SB
+44 303 040 9587
robert.foreman_at_rd.bbc.co.uk
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-08-31