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.

Re: how to stop curl_easy_perform() from another thread

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 19 Oct 2020 11:45:43 +0200 (CEST)

On Fri, 16 Oct 2020, Winnie Poon via curl-library wrote:

> * is it still unsafe to use the same handle in more than 1 thread?

This is a documented fact and is repeated fairly frequently:

   https://curl.haxx.se/libcurl/c/threadsafe.html

> * is the progress callback the only proper way to cancel curl_easy_perform?

Not exactly. You can cancel it in several different callbacks in addition to
the progress one.

If you want to avoid the up to a full second delay this introduces, I'd
recommend switching to the multi interface and curl_multi_poll() with
curl_multi_wakeup() from the second thread.

-- 
  / daniel.haxx.se | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-10-19