cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: can't get curl dns cache to work

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 5 Apr 2002 09:36:37 +0200 (MET DST)

On Fri, 5 Apr 2002, Phillip Stevens wrote:

> >Just being careful here, you aren't by any chance using persistant
> >connections here so that when you use short intervals the previous
> >connection is still alive and simply re-used?
>
> I'm using the same curl session, simply changing the CURLOPT_URL and then
> using 'perform' to retrieve the file. Never running cleanup until the end
> of program. I also tried alternating between two domains, hoping this would
> kill any live connections?

No, it won't. libcurl keeps a "connection cache" consisting of up to 5
connections (by default). So just altering between two domains do not close
the connections!

> I don't really need to use this cache timeout option anyway, just thought
> I'd let you know.

I firmly believe that you saw this behaviorr because the connections are kept
alive and then of course libcurl doesn't resolve the host names again.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-05