diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-09-21 08:52:57 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-09-22 09:47:59 +0200 |
commit | 46f3fe0e75aa4cd1ae057b3703a6ddd272356813 (patch) | |
tree | dc40f3b20165838a8e04184613a636224b91dc1d /lib/asyn-thread.c | |
parent | 7295e62c66cac62751a0a9964dc317048d145524 (diff) | |
download | curl-46f3fe0e75aa4cd1ae057b3703a6ddd272356813.tar.gz |
hostip: lazily wait to figure out if IPv6 works until needed
The check may take many milliseconds, so now it is performed once the
value is first needed. Also, this change makes sure that the value is
not used if the resolve is set to be IPv4-only.
Closes #9553
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r-- | lib/asyn-thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 68fddf0b2..8b375eb5e 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -707,7 +707,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data, *waitp = 0; /* default to synchronous response */ #ifdef CURLRES_IPV6 - if(Curl_ipv6works(data) && data->conn->ip_version != CURL_IPRESOLVE_V4) + if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data)) /* The stack seems to be IPv6-enabled */ pf = PF_UNSPEC; #endif /* CURLRES_IPV6 */ |