cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Pause the transfer.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 27 Jan 2006 11:00:01 +0100 (CET)

On Thu, 26 Jan 2006, Anton Rakovchuk wrote:

> I've got another issue to work around. The man page for write_callback
> function is saying that if this function returns the different number than
> the number of bytes available in the buffer the library will abort the
> transfer with CURL_WRITE_ERROR code. The question: is there a way to pause
> the transfer? My application might not be able to consume all provided data
> immediately, so I would like to put given transfer on hold and resume it
> later on some specific condition in my application. I thought I could just
> remove easy handle from multi handle and put it back, but it seems to me it
> will restart the transfer from the beginning. Is there any sort of
> technique to do that?

Not other than simply not calling curl_multi_perform() or just not returning
from the callback until things are clear again.

The TODO doc mentions the lack of a feature like this and has done so for
years. I would welcome a way that pauses the transfer and thus won't make
libcurl attempt to download or upload on that connection until it is again
"unpaused". Feel free to dig in and suggest an API/provide patches for how to
accomplish this. I'm quite sure more people than you will enjoy it, since we
get this question every now and then...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-01-27