cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_DNS_CACHE_TIMEOUT and DNS queries

From: Pankaj Takawale <pankaj.takawale_at_gmail.com>
Date: Tue, 19 Apr 2011 18:23:57 -0400

My environment:
curl: 7.21.4
CURLOPT_DNS_CACHE_TIMEOUT: 30 secs
CURLOPT_DNS_USE_GLOBAL_CACHE: 1
Connection : persistent

Server breaks connection every minute. Then I use CONNECT_ONLY to make
connection if its broken, so that subsequent requests always gets good
connection.

I'm capturing DNS queries (filter: udp port 53). I can see DNS queries
to targeted server are captured when I start application.
But after every 30 secs, when DNS cache times out, there are no
further DNS queries issued by application.

I tried putting breakpoint on lib/url.c:Curl_hostcache_prune
lib/hostip.c:hostcache_timestamp_remove, and I see cache entry is
being removed.
Why further request is not issuing DNS query?

When I turn off DNS caching, I can see DNS queries captured for every request.

-- 
Pankaj Takawale
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-20