diff options
-rw-r--r-- | src/tool_cfgable.h | 8 | ||||
-rw-r--r-- | src/tool_getparam.c | 2 | ||||
-rw-r--r-- | src/tool_operate.c | 12 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 07355b8f4..2f9cd5afb 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -66,10 +66,10 @@ struct Configurable { char *range; long low_speed_limit; long low_speed_time; - char* dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */ - char* dns_interface; /* interface name */ - char* dns_ipv4_addr; /* dot notation */ - char* dns_ipv6_addr; /* dot notation */ + char *dns_servers; /* dot notation: 1.1.1.1;2.2.2.2 */ + char *dns_interface; /* interface name */ + char *dns_ipv4_addr; /* dot notation */ + char *dns_ipv6_addr; /* dot notation */ int showerror; /* -1 == unset, default => show errors 0 => -s is used to NOT show errors 1 => -S has been used to show errors */ diff --git a/src/tool_getparam.c b/src/tool_getparam.c index d23084f57..583a84162 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -80,7 +80,7 @@ static const struct LongShort aliases[]= { {"*B", "bearer", TRUE}, {"*c", "connect-timeout", TRUE}, {"*d", "ciphers", TRUE}, - {"*D", "dns-interface", TRUE}, + {"*D", "dns-interface", TRUE}, {"*e", "disable-epsv", FALSE}, {"*E", "epsv", FALSE}, /* 'epsv' made like this to make --no-epsv and --epsv to work 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: */ |