From f73de32d469919478fba65b5f4fda6212dc730cd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Mar 2019 15:39:43 +0100 Subject: CURLOPT_DNS_USE_GLOBAL_CACHE: remove Remove the code too. The functionality has been disabled in code since 7.62.0. Setting this option will from now on simply be ignored and have no function. Closes #3654 --- tests/unit/unit1607.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'tests/unit/unit1607.c') diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 22c2e8482..6e40be707 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -31,12 +31,8 @@ bool getaddressinfo(struct sockaddr *sa, char *addr, long *port); #include "memdebug.h" /* LAST include file */ -static struct Curl_easy *easy; -static struct curl_hash *hostcache; - static void unit_stop(void) { - curl_easy_cleanup(easy); curl_global_cleanup(); } @@ -46,18 +42,6 @@ static CURLcode unit_setup(void) global_init(CURL_GLOBAL_ALL); - easy = curl_easy_init(); - if(!easy) { - curl_global_cleanup(); - return CURLE_OUT_OF_MEMORY; - } - - hostcache = Curl_global_host_cache_init(); - if(!hostcache) { - unit_stop(); - return CURLE_OUT_OF_MEMORY; - } - return res; } @@ -122,7 +106,7 @@ UNITTEST_START int i; int testnum = sizeof(tests) / sizeof(struct testcase); - for(i = 0; i < testnum; ++i, curl_easy_reset(easy)) { + for(i = 0; i < testnum; ++i) { int j; int addressnum = sizeof(tests[i].address) / sizeof(*tests[i].address); struct Curl_addrinfo *addr; @@ -130,10 +114,17 @@ UNITTEST_START struct curl_slist *list; void *entry_id; bool problem = false; + struct Curl_multi *multi; + struct Curl_easy *easy = curl_easy_init(); + if(!easy) { + curl_global_cleanup(); + return CURLE_OUT_OF_MEMORY; + } - Curl_hostcache_clean(easy, hostcache); - easy->dns.hostcache = hostcache; - easy->dns.hostcachetype = HCACHE_GLOBAL; + /* create a multi handle and add the easy handle to it so that the + hostcache is setup */ + multi = curl_multi_init(); + curl_multi_add_handle(multi, easy); list = curl_slist_append(NULL, tests[i].optval); if(!list) @@ -214,7 +205,8 @@ UNITTEST_START addr = addr->ai_next; } - Curl_hostcache_clean(easy, easy->dns.hostcache); + curl_easy_cleanup(easy); + curl_multi_cleanup(multi); curl_slist_free_all(list); if(problem) { -- cgit v1.2.3