aboutsummaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-04 10:36:51 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-10-04 10:36:51 +0000
commit95def48071e54c769ee063ddf53f05c9595602d2 (patch)
tree92fb9afab75a2ebad3a2c8f19096ccad2da851ea /lib/hostip.c
parent2ee6c334126b257708ac92b19c57701e18bb31cc (diff)
Made the dns entry remain locked while a connection to the host remains to
allow verbose output during this period. Bertrand Demiddelaer reported and helped fixing.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index f3aa36c6a..c9c78784f 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -263,8 +263,9 @@ void Curl_hostcache_prune(struct SessionHandle *data)
{
time_t now;
- if(data->set.dns_cache_timeout == -1)
- /* cache forever means never prune! */
+ if((data->set.dns_cache_timeout == -1) || !data->hostcache)
+ /* cache forever means never prune, and NULL hostcache means
+ we can't do it */
return;
if(data->share)
@@ -459,7 +460,11 @@ int Curl_resolv(struct connectdata *conn,
}
}
else {
+ if(data->share)
+ Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
dns->inuse++; /* we use it! */
+ if(data->share)
+ Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
rc = CURLRESOLV_RESOLVED;
}