diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-04-25 19:00:57 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-04-25 19:00:57 +0000 |
commit | 8927ddec1687a438354eae6c527da92c6c63b50b (patch) | |
tree | 5f443d4fa1d0ebf681b0ff88dc5ea06c8b8043c9 /lib/hostip.c | |
parent | f6525ae20087290e1ce91839461e671b9ec81cc0 (diff) |
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.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |