mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:43:32 +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
10
lib/setopt.c
10
lib/setopt.c
|
|
@ -1569,11 +1569,6 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option,
|
|||
if(data->share) {
|
||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||
|
||||
if(data->dns.hostcachetype == HCACHE_SHARED) {
|
||||
data->dns.hostcache = NULL;
|
||||
data->dns.hostcachetype = HCACHE_NONE;
|
||||
}
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||
if(data->share->cookies == data->cookies)
|
||||
data->cookies = NULL;
|
||||
|
|
@ -1603,11 +1598,6 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option,
|
|||
|
||||
data->share->dirty++;
|
||||
|
||||
if(data->share->specifier & (1 << CURL_LOCK_DATA_DNS)) {
|
||||
/* use shared host cache */
|
||||
data->dns.hostcache = &data->share->hostcache;
|
||||
data->dns.hostcachetype = HCACHE_SHARED;
|
||||
}
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||
if(data->share->cookies) {
|
||||
/* use shared cookie list, first free own one if any */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue