mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:53:34 +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
|
|
@ -46,7 +46,7 @@ curl_share_init(void)
|
|||
if(share) {
|
||||
share->magic = CURL_GOOD_SHARE;
|
||||
share->specifier |= (1 << CURL_LOCK_DATA_SHARE);
|
||||
Curl_init_dnscache(&share->hostcache, 23);
|
||||
Curl_dnscache_init(&share->dnscache, 23);
|
||||
share->admin = curl_easy_init();
|
||||
if(!share->admin) {
|
||||
free(share);
|
||||
|
|
@ -247,7 +247,8 @@ curl_share_cleanup(CURLSH *sh)
|
|||
if(share->specifier & (1 << CURL_LOCK_DATA_CONNECT)) {
|
||||
Curl_cpool_destroy(&share->cpool);
|
||||
}
|
||||
Curl_hash_destroy(&share->hostcache);
|
||||
|
||||
Curl_dnscache_destroy(&share->dnscache);
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||
Curl_cookie_cleanup(share->cookies);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue