mirror of
https://github.com/curl/curl.git
synced 2026-08-04 09:30:03 +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
|
|
@ -901,6 +901,7 @@ UNITTEST void de_cleanup(struct dohentry *d)
|
|||
CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
|
||||
struct Curl_dns_entry **dnsp)
|
||||
{
|
||||
struct connectdata *conn = data->conn;
|
||||
CURLcode result;
|
||||
struct dohdata *dohp = data->req.doh;
|
||||
*dnsp = NULL; /* defaults to no response */
|
||||
|
|
@ -909,7 +910,7 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
|
|||
|
||||
if(!dohp->probe[DOH_PROBE_SLOT_IPADDR_V4].easy &&
|
||||
!dohp->probe[DOH_PROBE_SLOT_IPADDR_V6].easy) {
|
||||
failf(data, "Could not DoH-resolve: %s", data->state.async.hostname);
|
||||
failf(data, "Could not DoH-resolve: %s", conn->resolve_async.hostname);
|
||||
return CONN_IS_PROXIED(data->conn)?CURLE_COULDNT_RESOLVE_PROXY:
|
||||
CURLE_COULDNT_RESOLVE_HOST;
|
||||
}
|
||||
|
|
@ -970,7 +971,7 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
|
|||
Curl_freeaddrinfo(ai);
|
||||
}
|
||||
else {
|
||||
data->state.async.dns = dns;
|
||||
conn->resolve_async.dns = dns;
|
||||
*dnsp = dns;
|
||||
result = CURLE_OK; /* address resolution OK */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue