diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-09-13 18:50:11 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-09-13 18:50:11 +0100 |
commit | c243d45aadb502301e5e92d6f87af1d434ce98b4 (patch) | |
tree | 36d21a75018566a58c9828092185f8d773677b69 /src/tool_operate.c | |
parent | 8a6dba520bfc81a5bc6ffcd38bedc73b8e520c8e (diff) |
curl: Fixed usage of DNS options when not using c-ares resolver
Commit 32352ed6adddcb introduced various DNS options, however, these
would cause curl to exit with CURLE_NOT_BUILT_IN when c-ares wasn't
being used as the backend resolver even if the options weren't set
by the user.
Additionally corrected some minor coding style errors from the same
commit.
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r-- | src/tool_operate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index ba077973e..6615270e0 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1239,10 +1239,16 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[]) my_setopt(curl, CURLOPT_PROGRESSDATA, &progressbar); } - my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers); + /* new in libcurl 7.24.0: */ + if(config->dns_servers) + my_setopt_str(curl, CURLOPT_DNS_SERVERS, config->dns_servers); + /* new in libcurl 7.33.0: */ - my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface); - my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr); + if(config->dns_interface) + my_setopt_str(curl, CURLOPT_DNS_INTERFACE, config->dns_interface); + if(config->dns_ipv4_addr) + my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP4, config->dns_ipv4_addr); + if(config->dns_ipv6_addr) my_setopt_str(curl, CURLOPT_DNS_LOCAL_IP6, config->dns_ipv6_addr); /* new in libcurl 7.6.2: */ |