mirror of
https://github.com/curl/curl.git
synced 2026-08-25 03:43:31 +03:00
hostip: do DNS cache pruning in milliseconds
Instead of using integer seconds. Also: if the cache contains over 30,000 entries after first pruning, it makes anoter round and removes all entries that are older than half the age of the oldest entry until it goes below 30,000. Closes #18160
This commit is contained in:
parent
be71475b13
commit
854b0e230c
6 changed files with 51 additions and 45 deletions
|
|
@ -193,7 +193,7 @@ static CURLcode test_unit1607(const char *arg)
|
|||
break;
|
||||
}
|
||||
|
||||
if(dns->timestamp && tests[i].permanent) {
|
||||
if(dns->timestamp.tv_sec && tests[i].permanent) {
|
||||
curl_mfprintf(stderr,
|
||||
"%s:%d tests[%d] failed. the timestamp is not zero "
|
||||
"but tests[%d].permanent is TRUE\n",
|
||||
|
|
@ -202,7 +202,7 @@ static CURLcode test_unit1607(const char *arg)
|
|||
break;
|
||||
}
|
||||
|
||||
if(dns->timestamp == 0 && !tests[i].permanent) {
|
||||
if(dns->timestamp.tv_sec == 0 && !tests[i].permanent) {
|
||||
curl_mfprintf(stderr, "%s:%d tests[%d] failed. the timestamp is zero "
|
||||
"but tests[%d].permanent is FALSE\n",
|
||||
__FILE__, __LINE__, i, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue