diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-11-05 22:31:40 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-11-08 08:56:21 +0100 |
commit | 1b24b89cca3c06e36b69969af8edeeaca659515b (patch) | |
tree | baa8fdb1a290d28e7bf7ca54ca8fd482dc98c3dc /lib/url.c | |
parent | dc3e7df1c99c2ee9dae06453adbb94fe9584bf75 (diff) |
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/url.c')
-rw-r--r-- | lib/url.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1750,6 +1750,20 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, */ data->set.quote = va_arg(param, struct curl_slist *); break; + case CURLOPT_RESOLVE: + /* + * List of NAME:[address] names to populate the DNS cache with + * Prefix the NAME with dash (-) to _remove_ the name from the cache. + * + * Names added with this API will remain in the cache until explicitly + * removed or the handle is cleaned up. + * + * This API can remove any name from the DNS cache, but only entries + * that aren't actually in use right now will be pruned immediately. + */ + data->set.resolve = va_arg(param, struct curl_slist *); + data->change.resolve = data->set.resolve; + break; case CURLOPT_PROGRESSFUNCTION: /* * Progress callback function |