Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CURLOPT_RESOLVE and nearly expired DNS Cache entries: replace old entry #2622
We use CURLOPT_RESOLVE to tell Curl to use specific addresses instead of doing real DNS lookup.
when cached address is already there (saved by Curl internally) and close to expire, then by the time next http request is made, it can get expired.
Partial fix would be to mark existing entry as set by CURLOPT_RESOLVE (by setting timestamp to zero). This will keep this entry permanently in the cache as intended.
However, currently, if the cache entry already exists, CURLOPT_RESOLVE just leaves it, thus
Let's say that cURL already looked up "example.org" recently and found its IP address to be 184.108.40.206.
Then, if we do:
So it is best if we always override existing entries.