summaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-11-05 22:31:40 +0100
committerDaniel Stenberg <daniel@haxx.se>2010-11-08 08:56:21 +0100
commit1b24b89cca3c06e36b69969af8edeeaca659515b (patch)
treebaa8fdb1a290d28e7bf7ca54ca8fd482dc98c3dc /lib/hostip.c
parentdc3e7df1c99c2ee9dae06453adbb94fe9584bf75 (diff)
downloadcurl-1b24b89cca3c06e36b69969af8edeeaca659515b.tar.gz
CURLOPT_RESOLVE: added
CURLOPT_RESOLVE is a new option that sends along a curl_slist with name:port:address sets that will populate the DNS cache with entries so that request can be "fooled" to use another host than what otherwise would've been used. Previously we've encouraged the use of Host: for that when dealing with HTTP, but this new feature has the added bonus that it allows the name from the URL to be used for TLS SNI and server certificate name checks as well. This is a first change. Surely more will follow to make it decent.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 8f6a52e4f..8e1494e3f 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -421,6 +421,9 @@ int Curl_resolv(struct connectdata *conn,
/* See if its already in our dns cache */
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1);
+ /* free the allocated entry_id again */
+ free(entry_id);
+
/* See whether the returned entry is stale. Done before we release lock */
if( remove_entry_if_stale(data, dns) )
dns = NULL; /* the memory deallocation is being handled by the hash */
@@ -433,9 +436,6 @@ int Curl_resolv(struct connectdata *conn,
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
- /* free the allocated entry_id again */
- free(entry_id);
-
if(!dns) {
/* The entry was not in the cache. Resolve it to IP address */