]> granicus.if.org Git - curl/commitdiff
c-ares: honor port numbers in CURLOPT_DNS_SERVERS
authorJames Brown <roguelazer@roguelazer.com>
Mon, 24 Jun 2019 06:15:02 +0000 (23:15 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 24 Jun 2019 13:34:16 +0000 (15:34 +0200)
By using ares_set_servers_ports_csv on new enough c-ares.

Fixes #4066
Closes #4067

lib/asyn-ares.c

index 8561a4724642f4d1ee753d1f82b9f8ba184257c2..6b14aa69815e4db34cf81924f797e45601c37a2b 100644 (file)
@@ -734,7 +734,11 @@ CURLcode Curl_set_dns_servers(struct Curl_easy *data,
     return CURLE_OK;
 
 #if (ARES_VERSION >= 0x010704)
+#if (ARES_VERSION >= 0x010b00)
+  ares_result = ares_set_servers_ports_csv(data->state.resolver, servers);
+#else
   ares_result = ares_set_servers_csv(data->state.resolver, servers);
+#endif
   switch(ares_result) {
   case ARES_SUCCESS:
     result = CURLE_OK;