cURL / Mailing Lists / curl-library / Single Mail

curl-library

Change curl easy options for ongoing transfer

From: Saikrishna Bhagavatula <saikrishnabhagavatula_at_gmail.com>
Date: Wed, 3 Sep 2014 09:35:18 -0700

Hi,

It is my understanding that setting curl_easy_setopt() options only take
effect for subsequent transfers and will not have any effect on an ongoing
transfer. Is there a way to update some options so that they take immediate
effect on an ongoing transfer ? If not, can we modify libcurl to do this?

In our scenario, we have long duration transfers. A PUT message is issued
to a server and 100-Continue is returned after which data is periodically
sent using chunked encoding. The entire request can take around 30minutes
or even longer. We are using the multi socket API with libevent, and
pausing the easy handle using CURL_READFUNC_PAUSE until data is available
to write.

We would like to change the CURLOPT_LOW_SPEED_TIME at some points during
the transfer (like after the initial 100-Continue header). Some of these
delays in writing can be predicted and we do not want the transfer to be
aborted in such cases. So we either want to disable the
CURLOPT_LOW_SPEED_TIME and enable it later or set a larger value and
 change it later.

What do you think of a curl_easy_setopt_immediate() which can take some
curl options which can be changed during a transfer. This will really be
useful for long duration transfers (In our case, even the GET transfers
take very long - several hours).

Also, wouldn't it be better if CURLOPT_LOW_SPEED_TIME does not come into
effect for PAUSED transfers? or if we can have a new option that enforces
 CURLOPT_LOW_SPEED_TIME only works on non-PAUSED transfers ?

Please share your views, we do not mind developing a libcurl enhancement to
accomplish this kind of functionality.

Thank you,
Saikrishna Bhagavatula

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-09-03