cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DNS cache size control

From: Sterling Hughes <sterling_at_bumblebury.com>
Date: Wed, 17 Apr 2002 23:31:31 -0400

>
> > > Right. Stupid, really.
> >
> > I've added a patch to CVS which prunes old entries on each call to
> > Curl_resolv, this can certainly be optimized a bit (both in hash table
> > implementation, and the Curl_resolv function call), but it is a first
> > step to getting this fixed.
> >
> Yeah! Are you pruning the old entries based on the timeout value of DNS
> entry? With this and the option of setting DNS cache timeout, my problem is
> solved implicitly.
>

yep... :)

I can also add a function to "prune" out these entries, so you would
call (function name certainly not in stone :):

curl_dns_clear(CURL *cp, int age);

and it would prune all entries in cp->hostcache (which is, depending on
your preferences, a local cache, multi-handle cache or a global cache)
that are older than "age".

-Sterling
Received on 2002-04-18