curl-library
Re: [PATCH] pausing a transfer, take one
Date: Sat, 22 Dec 2007 14:11:22 +0600
Hello, Daniel.
> I've written up a lil' patch that introduces support for pausing libcurl
> transfers. The pausing can be done with curl_easy_pause() or by returning the
> magic return code from the read or write callbacks. See details in the
> curl_easy_pause.3 man page which is incluced in the patch.
> Unpausing a transfer is done using curl_easy_pause().
> I'm interested in comments on both the API/concept but also on how it actually
> works, as I've only tested it slightly but it seems to work fine for me.
This is a great news! Many thanks for working on that, Daniel!
I've applied the patch to CVS version of curl, retrieved at 12/19/07.
So far I've tested it with write-callback only and got the following
results.
Unfortunately retrieving of resources not works properly when callback
uses CURL_WRITEFUNC_PAUSE.
The test code is attached. In this test case write-callback returns
CURL_WRITEFUNC_PAUSE every second time it is called (starting from the
first time). And CURLPAUSE_CONT performed periodically after several
curl_multi_perform calls (this defined by WAIT_COUNT macro).
With disabled pause-routines (commenting the '#define USE_PAUSE'
string) retrieving of file via HTTP works properly. When pause is
enabled, the retrieved resource is corrupted.
-- Best regards, Dmitriy Sergeyev C++ Developer of ISS Art, Ltd., Omsk, Russia. http://issart.com
- TEXT/PLAIN attachment: test_pause01.c