Yes, doing things "lazily" in Daniel's PR fixes the problem for explicit CURL_IPRESOLVE_V4, which will not call Curl_ipv6works() anymore. But the problem is still there for the CURL_IPRESOLVE_WHATEVER, which is the default value for the CURLOPT_IPRESOLVE option.
So, migration from IPv4-enabled single-stack libcurl to IPv6-enabled dual-stack libcurl will introduce this problem if the default CURLOPT_IPRESOLVE option is used. And for IPv4-enabled libcurl, there was no reason to set this option, so most of the migrated code (if not all) will use default CURL_IPRESOLVE_WHATEVER value and step on this issue. Also, when IPv6 or dual stack is really desired or needed, the Curl_ipv6works() may still be not the best choice, and a better approach for "IPv6 works" is needed to avoid artificial connection creation regressions caused by the default Curl_ipv6works(). For such cases, the "curl_global_init_ipv6() with callback" approach will be a good addition to Daniel's PR, which will help to close performance gaps between the single-stack and IPv6-enabled dual-stack libcurls. It will help applications to provide better and faster ways to detect whether IPv6 works or not on their systems and avoid unnecessary connection delays for CURL_IPRESOLVE_WHATEVER, which is also the default mode. Thanks, Dmitry Karpov -----Original Message----- From: curl-library <curl-library-boun...@lists.haxx.se> On Behalf Of Daniel Stenberg via curl-library Sent: Tuesday, September 20, 2022 11:57 PM To: Daniel Stenberg via curl-library <curl-library@lists.haxx.se> Cc: Daniel Stenberg <dan...@haxx.se> Subject: [EXTERNAL] Re: Feature request: provide ability to set a global callback function telling libcurl if IPv6 works on the system On Wed, 21 Sep 2022, Daniel Stenberg via curl-library wrote: > Yes. It sounds like we should be able to fix this by "lazily" do the > check first when it is actually necessary to know. If set to > CURL_IPRESOLVE_V4 there's no need to know. Whatever we decide here, I think this is a good idea so I went ahead and made a pull-request with a change like this. See https://github.com/curl/curl/pull/9553 -- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html -- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html -- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html