mirror of
https://github.com/curl/curl.git
synced 2026-08-26 09:03:38 +03:00
c-ares: really lazy init channel
Only initialize the c-ares channel when we start resolving and not alreads when the application sets `CURLOPT_DNS_SERVERS` and friends. Creating an ares channel takes considerable time and when we have the DNS information for a transfer already cached, we do not need it. Closes #17167
This commit is contained in:
parent
437c72fbba
commit
7bf576064c
4 changed files with 86 additions and 115 deletions
22
lib/easy.c
22
lib/easy.c
|
|
@ -1050,28 +1050,6 @@ CURL *curl_easy_duphandle(CURL *d)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CURLRES_ARES
|
||||
{
|
||||
CURLcode rc;
|
||||
|
||||
rc = Curl_set_dns_servers(outcurl, data->set.str[STRING_DNS_SERVERS]);
|
||||
if(rc && rc != CURLE_NOT_BUILT_IN)
|
||||
goto fail;
|
||||
|
||||
rc = Curl_set_dns_interface(outcurl, data->set.str[STRING_DNS_INTERFACE]);
|
||||
if(rc && rc != CURLE_NOT_BUILT_IN)
|
||||
goto fail;
|
||||
|
||||
rc = Curl_set_dns_local_ip4(outcurl, data->set.str[STRING_DNS_LOCAL_IP4]);
|
||||
if(rc && rc != CURLE_NOT_BUILT_IN)
|
||||
goto fail;
|
||||
|
||||
rc = Curl_set_dns_local_ip6(outcurl, data->set.str[STRING_DNS_LOCAL_IP6]);
|
||||
if(rc && rc != CURLE_NOT_BUILT_IN)
|
||||
goto fail;
|
||||
}
|
||||
#endif /* USE_ARES */
|
||||
|
||||
outcurl->magic = CURLEASY_MAGIC_NUMBER;
|
||||
|
||||
/* we reach this point and thus we are OK */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue