mirror of
https://github.com/curl/curl.git
synced 2026-08-25 16:33:38 +03:00
dnscache: slight refactoring
Slight refactoring around dnscache, e.g. hostcache - eliminate `data->state.hostcache`. Always look up relevant dnscache at share/multi. - unify naming to "dnscache", replacing "hostcache" - use `struct Curl_dnscache`, even though it just contains a `Curl_hash` for now. - add `Curl_dnscache_destroy()` for cleanup in share/multi. Closes #16941
This commit is contained in:
parent
6140a574de
commit
01e76702ac
14 changed files with 217 additions and 255 deletions
|
|
@ -72,18 +72,11 @@ CURLcode Curl_addrinfo_callback(struct Curl_easy *data,
|
|||
|
||||
if(CURL_ASYNC_SUCCESS == status) {
|
||||
if(ai) {
|
||||
if(data->share)
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
||||
dns = Curl_cache_addr(data, ai,
|
||||
data->conn->host.dispname, 0,
|
||||
data->state.async.port, FALSE);
|
||||
if(data->share)
|
||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||
|
||||
if(!dns) {
|
||||
/* failed to store, cleanup and return error */
|
||||
Curl_freeaddrinfo(ai);
|
||||
/* failed to store, return error */
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue