cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: using curl_easy_pause()

From: Hrishikesh Murukkathampoondi <hrishim_at_gmail.com>
Date: Thu, 5 Aug 2010 17:08:21 +0530

On 05-Aug-2010, at 4:52 PM, Hrishikesh Murukkathampoondi wrote:

> I read through the libcurl-tutorial and I am able to set up a handle, options, and call curl_easy_perform() to download a file. But I do not understand how I can use curl_easy_pause() to pause the download.
>
> In my application I spawn a separate thread that uses lib-curl to download this file so I initially thought I can call easy_pause from the main thread. But the documentation at http://curl.haxx.se/libcurl/c/curl_easy_pause.html says that the function should not be called from another thread.
>
> The call to curl_easy_perform() will not return till the download is complete so I cannot call curl_easy_pause() from the same thread.
>
> I am missing something/ Could someone tell me the correct way to use curl_easy_pause()?
>
> Thank you
> Hrishi

I think http://article.gmane.org/gmane.comp.web.curl.library/17141/match=curl%5feasy%5fpause answers my question.

curl_easy_pause() should be called from one of the callback functions. I guess the CURL handle should be packaged as an argument into the callback function somehow.

Hrishi
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-05