curl-library
AW: Fixing CURLOPT_RESOLVE
Date: Tue, 17 Mar 2015 11:05:45 +0000
Hi,
you cannot change existing DNS entries after they have been added, because the entries are possibly shared between multiple threads, and only the access to the cache itself (and the ->inuse counter) is synchronized.
Best regards,
Stefan Bühler
Von: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] Im Auftrag von Ray Satiro via curl-library
Gesendet: Sonntag, 8. März 2015 22:35
An: Libcurl Development
Betreff: Re: Fixing CURLOPT_RESOLVE
On 3/2/2015 2:28 AM, Ray Satiro wrote:
I've started some work on fixing CURLOPT_RESOLVE. I have fixed it so that multiple addresses can be stored for each host:port. You can see a branch comparison at [1]. I'm exploring the removal of cache entries now. Currently it is documented that an entry can be removed by -host:port but it is not implemented [2][3]. I can't see an easy way to do it. If a Curl_dns_entry has an inuse count and that count is 1 it seems to me there's really no way to tell if that's because it's a user initiated entry (ie CURLOPT_RESOLVE incremented inuse so the cache entry is always in use) or because it's actually in use.
[...]
[1]: https://github.com/bagder/curl/compare/master...jay:fix-curlopt_resolve?expand=1
[2]: http://curl.haxx.se/libcurl/c/CURLOPT_RESOLVE.html
[3]: https://github.com/bagder/curl/blob/17abfd5/lib/hostip.c#L800-L802
I didn't get any feedback on this so I just went ahead and wrote it in the way I think is most correct. https://github.com/jay/curl/commit/1ae8b1f
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-17