Revert "urldata: move async resolver state from easy handle to connectdata"

This reverts commit 56a4db2e4e (#12198)

We want the c-ares channel to be held in the easy handle, not per
connection - for performance.

Closes #12524
This commit is contained in:
Daniel Stenberg 2023-12-14 23:25:09 +01:00
parent 9f2d2290d1
commit 907eea0804
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 138 additions and 155 deletions

View file

@ -67,11 +67,10 @@ CURLcode Curl_addrinfo_callback(struct Curl_easy *data,
int status,
struct Curl_addrinfo *ai)
{
struct connectdata *conn = data->conn;
struct Curl_dns_entry *dns = NULL;
CURLcode result = CURLE_OK;
conn->resolve_async.status = status;
data->state.async.status = status;
if(CURL_ASYNC_SUCCESS == status) {
if(ai) {
@ -79,8 +78,8 @@ CURLcode Curl_addrinfo_callback(struct Curl_easy *data,
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
dns = Curl_cache_addr(data, ai,
conn->resolve_async.hostname, 0,
conn->resolve_async.port);
data->state.async.hostname, 0,
data->state.async.port);
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
@ -95,12 +94,12 @@ CURLcode Curl_addrinfo_callback(struct Curl_easy *data,
}
}
conn->resolve_async.dns = dns;
data->state.async.dns = dns;
/* Set async.done TRUE last in this function since it may be used multi-
threaded and once this is TRUE the other thread may read fields from the
async struct */
conn->resolve_async.done = TRUE;
data->state.async.done = TRUE;
/* IPv4: The input hostent struct will be freed by ares when we return from
this function */