From 8927ddec1687a438354eae6c527da92c6c63b50b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 25 Apr 2002 19:00:57 +0000 Subject: In order to not get problems with DNS cache pruning, we no longer store any name resolved data in any curl handle struct. That way, we won't mind if the cache entries are pruned for the next time we need them. We'll just resolve them again instead. This changes the Curl_resolv() proto. It modifies the SessionHandle struct but perhaps most importantly, it'll make the internals somewhat dependent on the DNS cache not being disabled as that will cripple operations somewhat. Especially for persistant connections. --- lib/hostip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/hostip.c') diff --git a/lib/hostip.c b/lib/hostip.c index 7bdb3ee7d..ea28b1cea 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -193,18 +193,18 @@ _curl_hostcache_prune(curl_hash *hostcache, int cache_timeout, int now) Curl_addrinfo *Curl_resolv(struct SessionHandle *data, char *hostname, - int port, - char **bufp) + int port) { char *entry_id = NULL; struct curl_dns_cache_entry *p = NULL; ssize_t entry_len; time_t now; + char *bufp; /* If the host cache timeout is 0, we don't do DNS cach'ing so fall through */ if (data->set.dns_cache_timeout == 0) { - return Curl_getaddrinfo(data, hostname, port, bufp); + return Curl_getaddrinfo(data, hostname, port, &bufp); } time(&now); @@ -220,7 +220,7 @@ Curl_addrinfo *Curl_resolv(struct SessionHandle *data, /* If we can't create the entry id, don't cache, just fall-through to the plain Curl_getaddrinfo() */ if (!entry_id) { - return Curl_getaddrinfo(data, hostname, port, bufp); + return Curl_getaddrinfo(data, hostname, port, &bufp); } /* See if its already in our dns cache */ @@ -236,7 +236,7 @@ Curl_addrinfo *Curl_resolv(struct SessionHandle *data, _hostcache_return(NULL); } - p->addr = Curl_getaddrinfo(data, hostname, port, bufp); + p->addr = Curl_getaddrinfo(data, hostname, port, &bufp); if (!p->addr) { free(p); _hostcache_return(NULL); -- cgit v1.2.3