curl-library
Make DNS requests follow the CURLOPT_INTERFACE if c-ares is in use
Date: Sun, 07 Apr 2013 13:17:57 -0400
Hello cURL hackers,
I created this a little while ago on the feature request tracker but I
saw some comments from Daniel to the effect that the mailing list may be
a better place for feature requests so I'll resend here.
I am using curl_easy_setopt(CURLOPT_INTERFACE, "if!something") to force
transfers to use a particular interface but this doesn't make DNS
requests use that interface.
I think most users would expect use of CURLOPT_INTERFACE to affect all
network traffic generated by the transfer including DNS requests.
If c-ares is in use, this is actually easy to implement because c-ares
already has a hook for it. I propose a small change that would make DNS
requests also follow the CURLOPT_INTERFACE binding if c-ares is in use.
If c-ares is not in use or if the c-ares version is too old to support
this, the behaviour would be the same as it is now. I could have made it
fail with CURLE_NOT_BUILT_IN but I don't think that's a good idea.
Original feature request:
https://sourceforge.net/p/curl/feature-requests/68/
Updated patch:
https://github.com/vandry/curl/commits/set-c-ares-interface
Please let me know if you think this makes sense.
-kv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-07