Hi, I think I did not explain myself clearly. What I've done is that for download I initiate a separate thread. The easyhandle is global. The dialog on which pause button is present is on the main thread. When user clicks pause I call curl_easy_pause() to pause the download. When user clicks Resume then I unpause using curl_easy_pause(). However the documentation of curl_easy_pause() clearly says that it must be called from the same thread where download is happening.
1) Though pause\resume works in my case from different threads but I need to know if I'm doing something wrong here and should take a different approach because documentation suggests that I'm using curl_easy_pause() in a wrong way. 2) Now other option for me is CURL_WRITEFUNC_PAUSE but if I use it then how do I unpause? Thanks, -kashif ----- Original Message ----- From: Clemens Gruber <[email protected]> To: Md Kashif <[email protected]>; libcurl development <[email protected]> Cc: Sent: Saturday, 7 September 2013 10:17 PM Subject: Re: How to resume a paused download. On 07.09.2013, at 18:01, Md Kashif <[email protected]> wrote: > Hi, > > I'm trying to implement a simple download manager application that supports > Pause\ Resume functionality that can pause or resume download based on a > button click from user. > As I see it I can pause my download by returning CURL_WRITEFUNC_PAUSE from my > write function. But I'm wondering how would I resume my download back because > the thread would just hang after returning CURL_WRITEFUNC_PAUSE. > Since I cannot call curl_easy_pause() from another thread how do I resume the > download? > > > Thanks. Hi, Take a look at curl_easy_pause: http://curl.haxx.se/libcurl/c/curl_easy_pause.html Best regards, Clemens ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
