mirror of
https://github.com/curl/curl.git
synced 2026-08-26 15:43:33 +03:00
urldata: move async resolver state from easy handle to connectdata
- resolving is done for a connection, not for every transfer - save create/dup/free of a cares channel for each transfer - check values of setopt calls against a local channel if no connection has been attached yet, when needed. Closes #12198
This commit is contained in:
parent
910f740ce2
commit
56a4db2e4e
10 changed files with 147 additions and 127 deletions
27
lib/easy.c
27
lib/easy.c
|
|
@ -968,33 +968,6 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
|
|||
(void)Curl_hsts_loadcb(outcurl, outcurl->hsts);
|
||||
}
|
||||
#endif
|
||||
/* Clone the resolver handle, if present, for the new handle */
|
||||
if(Curl_resolver_duphandle(outcurl,
|
||||
&outcurl->state.async.resolver,
|
||||
data->state.async.resolver))
|
||||
goto fail;
|
||||
|
||||
#ifdef USE_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 */
|
||||
|
||||
Curl_initinfo(outcurl);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue