GNURLOPT_DNS_USE_GLOBAL_CACHE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is the GNURLOPT_DNS_USE_GLOBAL_CACHE(3) page, living its best life inside the curl_easy_setopt options manual β€” and the whole point is CURLOPT_DNS_USE_GLOBAL_CACHE β€” enable/disable global DNS cache. lowkey a relic, but we're covering it fr fr πŸ’…

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DNS_USE_GLOBAL_CACHE,
                          long enable);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so boom: has no function since 7.62.0. Do note use! (the page literally says that, and it's giving warning-label drama 😭)

You pass a long. If the enable value is 1, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions. This is not thread-safe and this will use a global variable.

⚠️ WARNING: this option is considered obsolete. Stop using it. Switch over to using the share interface instead! See CURLOPT_SHARE(3) and curl_share_init(3). 🚨

πŸŽ€ DEFAULT πŸŽ€

0

🌈 PROTOCOLS 🌈

All

πŸ“ EXAMPLE πŸ“

CURL *curl = curl_easy_init();
if(curl) {
  CURLcode ret;
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  /* switch off the use of a global, thread unsafe, cache */
  curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0L);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Deprecated since 7.62.0. Has no function. πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. periodt.

🧚 SEE ALSO 🧚


okay bye bestie πŸ’– this page was brought to you by libcurl 7.37.0, dated 17 Jun 2014, and the manual name is still the iconic GNURLOPT_D...LOBAL_CACHE(3). slay ✨

πŸ“¦ where this page comes from