mirror of
https://github.com/curl/curl.git
synced 2026-08-26 11:43:32 +03:00
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
This commit is contained in:
parent
68dde8e330
commit
8324dc8b1a
6 changed files with 82 additions and 40 deletions
13
lib/setopt.c
13
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 *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue