1CURLOPT_DNS_USE_GLOBAL_CACHEc(u3r)l_easy_setopt optiCoUnRsLOPT_DNS_USE_GLOBAL_CACHE(3)
2
3
4

NAME

6       CURLOPT_DNS_USE_GLOBAL_CACHE - enable/disable global DNS cache
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_USE_GLOBAL_CACHE,
12                                 long enable);
13

DESCRIPTION

15       Pass  a  long.  If the enable value is 1, it tells curl to use a global
16       DNS cache that will survive between easy  handle  creations  and  dele‐
17       tions. This is not thread-safe and this will use a global variable.
18
19       WARNING: this option is considered obsolete. Stop using it. Switch over
20       to  using  the  share  interface  instead!  See  CURLOPT_SHARE(3)   and
21       curl_share_init(3).
22

DEFAULT

24       0
25

PROTOCOLS

27       All
28

EXAMPLE

30       CURL *curl = curl_easy_init();
31       if(curl) {
32         CURLcode ret;
33         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
34         /* switch off the use of a global, thread unsafe, cache */
35         curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
36         ret = curl_easy_perform(curl);
37         curl_easy_cleanup(curl);
38       }
39

AVAILABILITY

41       Subject for removal in the future. Do not use!
42

RETURN VALUE

44       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
45       if not.
46

SEE ALSO

48       CURLOPT_SHARE(3), CURLOPT_DNS_CACHE_TIMEOUT(3),
49
50
51
52libcurl 7.64.0                   May 31, 2017  CURLOPT_DNS_USE_GLOBAL_CACHE(3)
Impressum