cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] pausing a transfer, take one

From: Dmitriy Sergeyev <dsergeyev_at_issart.com>
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

Received on 2007-12-22