Thanks Dan, i ended up using the same approach as you have suggested, and it works great.Thanks for the reaffirmation.
On Sun, Jul 1, 2012 at 12:59 AM, Dan Fandrich <[email protected]>wrote: > On Sat, Jun 30, 2012 at 06:47:38PM +0500, Usman Raza wrote: > > Hello all, im using curl for chunked transfer in a separate thread, by > reading > > from a buffer, could anyone tell me how could i pause it, so i could > maybe > > switch to another thread (which will write to the buffer) and then > switch back > > to resume transfer? i did came across the curl_easy_pause(CURL *handle , > int > > bitmask ) function which could be used with returning > CURL_READFUNC_PAUSE from > > a callback, but im not sure how i can use it to accomplish thread > > synchronization.Appreciate any help on this.Thanks. > > libcurl is inherently paused while in a callback, so if you're just using > the easy interface and therefore have just a single transfer > outstanding, you can ignore curl_easy_pause and just do your thread > synchronization within the read callback. Simply don't return from that > callback with valid data until it's available! You can do any sort > of synchronization you want in that callback, just don't return before > the data is ready. > > >>> Dan > ------------------------------------------------------------------- > 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
