cURL / Mailing Lists / curl-library / Single Mail

curl-library

DNS caching - a documentation/implementation mismatch?

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Thu, 09 Feb 2006 13:35:55 +0200

The libcurl documentation says that setting CURLOPT_DNS_CACHE_TIMEOUT to zero disables caching completely. However my experience (and debugging) shows that this is not entirely accurate (version 7.15.1) at least not when the multi interface is used with a persistent connection cache. In Curl_resolv, the hostcache is checked (hostip.c:400) for the existence of an entry, and on hostip.c:444 an entry is added to the cache after a successful resolve. The timestamp is not checked until Curl_disconnect is called which in turn prunes the cache (url.c:1486) .

Maybe it is just me, but after reading the documentation I expected no DNS caching once CURLOPT_DNS_CACHE_TIMEOUT is set to zero. Or maybe it is an implementation bug? Anyway I suggest that something will be changed either the documentation or the implementation.

Cheers,
Shmulik Regev
Blue Security
http://www.bluesecurity.com
Received on 2006-02-09