mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
resolve with c-ares: don't resolve IPv6 when not working
If the Curl_ipv6works() function says no, there is no reason to try AAAA names even if libcurl was built with IPv6 support enabled. Bug: http://curl.haxx.se/mail/lib-2012-03/0045.html
This commit is contained in:
parent
e25590a2b3
commit
97386c3c84
@ -582,13 +582,22 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
|||||||
res->last_status = ARES_ENOTFOUND;
|
res->last_status = ARES_ENOTFOUND;
|
||||||
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
||||||
if(family == PF_UNSPEC) {
|
if(family == PF_UNSPEC) {
|
||||||
res->num_pending = 2;
|
if(Curl_ipv6works()) {
|
||||||
|
res->num_pending = 2;
|
||||||
|
|
||||||
/* areschannel is already setup in the Curl_open() function */
|
/* areschannel is already setup in the Curl_open() function */
|
||||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||||
PF_INET, query_completed_cb, conn);
|
PF_INET, query_completed_cb, conn);
|
||||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||||
PF_INET6, query_completed_cb, conn);
|
PF_INET6, query_completed_cb, conn);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res->num_pending = 1;
|
||||||
|
|
||||||
|
/* areschannel is already setup in the Curl_open() function */
|
||||||
|
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||||
|
PF_INET, query_completed_cb, conn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* CURLRES_IPV6 */
|
#endif /* CURLRES_IPV6 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user