mirror of
https://github.com/curl/curl.git
synced 2026-08-02 19:50:29 +03:00
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:
parent
9f2d2290d1
commit
907eea0804
11 changed files with 138 additions and 155 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue