From 8324dc8b1a730445e7aa91f62d7f88b8376e4aee Mon Sep 17 00:00:00 2001 From: Paul Groke Date: Thu, 10 Dec 2020 17:38:14 +0100 Subject: dns: extend CURLOPT_RESOLVE syntax for adding non-permanent entries Extend the syntax of CURLOPT_RESOLVE strings: allow using a '+' prefix (similar to the existing '-' prefix for removing entries) to add DNS cache entries that will time out just like entries that are added by libcurl itself. Append " (non-permanent)" to info log message in case a non-permanent entry is added. Adjust relevant comments to reflect the new behavior. Adjust documentation. Extend unit1607 to test the new functionality. Closes #6294 --- lib/setopt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/setopt.c') diff --git a/lib/setopt.c b/lib/setopt.c index a6cc562eb..cd7ec3fa8 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -1460,13 +1460,16 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) 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 + * List of HOST:PORT:[addresses] strings to populate the DNS cache with + * Entries added this way 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 + * Prefix the HOST with plus sign (+) to have the entry expire just like + * automatically added entries. + * + * Prefix the HOST with dash (-) to _remove_ the entry from the cache. + * + * This API can remove any entry 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 *); -- cgit v1.2.1