summaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
authorPaul Groke <paul.groke@dynatrace.com>2020-12-10 17:38:14 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-29 17:49:36 +0100
commit8324dc8b1a730445e7aa91f62d7f88b8376e4aee (patch)
treef4ef26e256e8887a5cc6adb34a3c504dcd5d449d /lib/setopt.c
parent68dde8e330a2580c1af3f34cc1971716948c307b (diff)
downloadcurl-8324dc8b1a730445e7aa91f62d7f88b8376e4aee.tar.gz
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
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c13
1 files changed, 8 insertions, 5 deletions
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 *);