cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: DNS Cache on Windows XP

From: Tracy Boehrer <tboehrer_at_calltower.com>
Date: Mon, 21 Jul 2003 08:18:29 -0700

I single stepped through the code, and while I'm not sure of what it's doing yet, here is what I have so far:

In Curl_resolv, line 259:

        /* See if its already in our dns cache */
        dns = Curl_hash_pick(data->hostcache, entry_id, entry_len+1);

It returns what appears to be a valid cache entry. However, in that same function, after line 289:

        /* Remove outdated and unused entries from the hostcache */
        hostcache_prune(data->hostcache,
                  data->set.dns_cache_timeout,
                  now);

'dns' appear to have been deleted. 'dns' itself still points to something, but the contents (fields) are freed. What is (if anything) supposed to happen after that?

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Saturday, July 19, 2003 2:36 PM
To: libcurl Mailing list
Subject: Re: DNS Cache on Windows XP

On Fri, 18 Jul 2003, Tracy Boehrer wrote:

> While in the process of tracking another bug (possibly not in libcurl), I
> ran into a problem with disabling the DNS cache on Windows XP (using
> CURLOPT_DNS_CACHE_TIMEOUT).

> I had introduced into a Java servlet a loop that would cause the TIMEOUT on
> libcurl would be hit. This seems to work fine, but the very next request
> (using the same curl handle) cause an exception in Curl_connecthost, line
> 604:
>
> if(!remotehost->addr->h_addr_list[0]) {
>
> It seems that 'remotehost->addr' is null.
>
> As soon as I turn DNS cache back on, it works fine.

Can you produce a reproducable source code example that we can use to debug
this problem or have you done any debugging on this case yourself that might
help us track this down even more?

Or can you explain with more details and perhaps single-step with a debugger
etc to better understand/explain what happens and why in this particular case?

I take it you're using 7.10.5 here?

> Also, previously we were using 7.10.1-1, and did not experience this
> problem.

I did some DNS-cache re-arranging, as the previous approach had a few bad
side-effects. It seems I didn't do a 100% working fix.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
Received on 2003-07-21