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.

Re: Repeated calls to ares_init when using c-ares

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 29 Jan 2020 08:51:13 +0100 (CET)

On Tue, 28 Jan 2020, Jeff Mears via curl-library wrote:

> Is there a way for libcurl to use one instance of c-ares, rather than trying
> to create one for every curl_easy_init?

There isn't any such right now, and doing one globally would be tricky while
mainaining thread safety. I can think of two ways to provide the feature:

1. It would perhaps make sense to add that ability to the share interface and
allow applications to explictly specify which handles should share the c-ares
instance?

2. A simpler method would possibly be to use a single c-ares "channel" for a
whole multi handle, as then you would just make sure to keep the multi handle
around when doing multiple transfers and c-ares wouldn't have to re-init.

-- 
  / 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-01-29