curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Calling curl_easy_pause in CURLOPT_XFERINFOFUNCTION and delay/frequency issue

From: Mushegh Malkhasyan via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 14 Jul 2020 17:40:28 -0700

I have a long-lasting upload where I have to pause the read by returning CURL_READFUNC_PAUSE from the read callback.  Once the data is available, I need to unpause the read. Initially, I was calling curl_easy_pause(curl, CURLPAUSE_SEND_CONT) which was not called from the callback thread but worked fine with the main issue being that unpausing would at times take over a second. I noticed that in the documentation it states that the unpausing should be called from a callback thread. I modified my code to trigger the unpausing from the transfer function (CURLOPT_XFERINFOFUNCTION) but it seems that this function also has a wide variability in the frequency of the call.

 

I am hoping that my questions can be answered here as I am drawing a blank:

 
What’s the best way to handle the situation when you don’t yet have the bits to submit (NOTE: I can’t block the curl thread as it serves the download)
Can I actually call curl unpause from an unrelated thread (seem to work on all platforms).
In case of directly unpausing from an unrelated thread – how can I make it more prompt as at times I see a delay of over a second?
In case of unpausing from the transfer/progress update callback – how can I make it to be called more frequent so I can unpause in time?
 

 

Thanks in advance

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-07-15