mirror of
https://github.com/moparisthebest/curl
synced 2025-01-01 17:08:00 -05:00
fix bug (?) :-)
previously, if you called curl_easy_perform and then set the global dns cache, the global cache wouldn't be used. I don't see this really happening in practice, but this code allows you to do it.
This commit is contained in:
parent
9b4f92130f
commit
cfb32da198
14
lib/easy.c
14
lib/easy.c
@ -233,15 +233,17 @@ CURLcode curl_easy_perform(CURL *curl)
|
|||||||
{
|
{
|
||||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||||
|
|
||||||
if (!data->hostcache) {
|
if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) {
|
||||||
if (Curl_global_host_cache_use(data)) {
|
if (data->hostcache) {
|
||||||
data->hostcache = Curl_global_host_cache_get();
|
Curl_hash_destroy(data->hostcache);
|
||||||
}
|
|
||||||
else {
|
|
||||||
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
|
||||||
}
|
}
|
||||||
|
data->hostcache = Curl_global_host_cache_get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!data->hostcache) {
|
||||||
|
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
||||||
|
}
|
||||||
|
|
||||||
return Curl_perform(data);
|
return Curl_perform(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user