Date: Mon, 2 Mar 2015 07:28:55 +0000 (UTC)
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 . 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 . 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.
I'm thinking I'll add a member to Curl_dns_entry struct like user_specified so that we can distinguish exactly how the entry originated rather than rely on inuse. Let's say this happens, then:- Should a dns entry be removed only if user_specified, for example if !user_specified then maybe the caller is trying to use -host:port to clear the DNS records retrieved by the resolver?- If inuse (and we know it's actually in use now) then the entry cannot be deleted, so it has to be pending for delete. What would be the best way to handle that? Say caller has this list: host = curl_slist_append(NULL, "-google.com:80");
host = curl_slist_append(host, "google.com:80:220.127.116.11");
host = curl_slist_append(host, "google.com:80:18.104.22.168");We can mark pending for delete somewhere (where?), then it would be pruned, but what to do about those next two entries? I was thinking maybe a swap space as another member of Curl_dns_entry like
Curl_addrinfo *addr, *swap;then swap during a prune or something. Just my thoughts so far, interested to get feedback.
Two more questions:- Shouldn't timeout be -1 for resolve entries?
- In the addrinfo comparison function I added I'm not comparing sin6_scope_id for IPv6, should I?
List admin: http://cool.haxx.se/list/listinfo/curl-library
Received on 2015-03-02