mirror of
https://github.com/curl/curl.git
synced 2026-07-29 21:48:04 +03:00
move Curl_share_lock and ref counting into Curl_fetch_addr
This commit is contained in:
parent
0db831976e
commit
b4be97fb67
3 changed files with 55 additions and 27 deletions
|
|
@ -1112,13 +1112,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
struct connectdata *conn = data->easy_conn;
|
||||
|
||||
/* check if we have the name resolved by now */
|
||||
if(data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
||||
dns = Curl_fetch_addr(conn, conn->host.name, (int)conn->port);
|
||||
|
||||
if(dns) {
|
||||
dns->inuse++; /* we use it! */
|
||||
#ifdef CURLRES_ASYNCH
|
||||
conn->async.dns = dns;
|
||||
conn->async.done = TRUE;
|
||||
|
|
@ -1127,9 +1123,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
infof(data, "Hostname was found in DNS cache\n");
|
||||
}
|
||||
|
||||
if(data->share)
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||
|
||||
if(!dns)
|
||||
result = Curl_resolver_is_resolved(data->easy_conn, &dns);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue