cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Usage of curl_easy_pause

From: Ravi Kasibhatla <kasibhatla.ravi_at_gmail.com>
Date: Mon, 19 Oct 2009 12:07:30 +0530

Hi,

I am attaching a sample program I have written to show usage of the
curl_easy_pause() API in my code. This sample program is not working as
expected. Please let me know if the usage of the API in my program is
correct or wrong. The *current output of the program* is below:*---- paused
the curl handle for perform *
*---- added the timer for 1sec *
*---- came to curl header callback *
*---- came to curl callback with data: *
*---- added the timer for 1sec again*
*---- added the timer for 1sec again*
*---- added the timer for 1sec again*
*---- continued the curl handle for perform *

The *output that I am looking* for should be something like below:
*---- paused the curl handle for perform *
*---- added the timer for 1sec *
*---- added the timer for 1sec again*
*---- added the timer for 1sec again*
*---- added the timer for 1sec again*
*---- continued the curl handle for perform *
*---- came to curl header callback *
*---- came to curl callback with data: *

Thanks in advance,
Ravi

On Thu, Oct 15, 2009 at 1:14 PM, Ravi Kasibhatla
<kasibhatla.ravi_at_gmail.com>wrote:

> Thanks Daniel for the clarification.
> In that scenario, the curl behavior in my code is not correct, because for
> me the callbacks are getting called even when the curl handle is in paused
> state. Can somebody point to me any example/test case, which shows how to
> use the api curl_easy_pause()? I searched for the example but couldn't find
> any.
>
> I am using the latest curl release i.e. 7.19.5 for my testing. I have also
> tested the same scenario with curl release 7.18.2.
>
> Thanks in advance,
> Ravi
>
>
> On Wed, Oct 14, 2009 at 8:31 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
>> On Wed, 7 Oct 2009, Ravi Kasibhatla wrote:
>>
>> I have a query regarding the usage of the function curl_easy_pause(). In
>>> my code, I have defined all the 3 curl callbacks i.e. header, write & read.
>>> For some condition I am calling curl_easy_pause() with CURLPAUSE_ALL mask
>>> value for a curl handle. After that also, I see the invocation of header
>>> callback by curl for that curl handle. Is this the expected behavior?
>>>
>>
>> No.
>>
>> From the given documentation, I came to the understanding that the API
>>> would just stop the calling of the read & write callbacks only (based on the
>>> mask value set). The curl header callback would be called irrespective of
>>> whether the curl handle is in paused state or not.
>>>
>>
>> No, the header callback is just a special write callback so a paused
>> transfer shouldn't call that either.
>>
>> --
>>
>> / daniel.haxx.se
>>
>> -------------------------------------------------------------------
>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>>
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2009-10-19