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:
Sterling Hughes 2003-01-06 06:17:15 +00:00
Родитель 9b4f92130f
Коммит cfb32da198
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -233,14 +233,16 @@ CURLcode curl_easy_perform(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
if (!data->hostcache) {
if (Curl_global_host_cache_use(data)) {
if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) {
if (data->hostcache) {
Curl_hash_destroy(data->hostcache);
}
data->hostcache = Curl_global_host_cache_get();
}
else {
if (!data->hostcache) {
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
}
}
return Curl_perform(data);
}