curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: [EXTERNAL] Re: Feature request: provide ability to set a global callback function telling libcurl if IPv6 works on the system

From: Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 20 Sep 2022 12:57:50 -0700

On Tue, Sep 20, 2022 at 07:24:42PM +0000, Dmitry Karpov wrote:
> Not necessarily.
> If we have a bunch of applications on the system with large codebases which use CURLOPT_IPRESOLVE = AUTO in too many places, then all these places should detect somehow that "IPv6 doesn't work" and change the resolve mode to IPv4. It is just not always feasible or desirable.
>
> The "curl_global_init_ipv6() with callback" solves this problem very easily and cleanly - as just one global callback can instantly tell all multi handles created in the application that "IPv6 doesn't work" and let them all fall back to IPv4.

I don't see your argument. Either you want IPv6 for a connection or you don't.
Just set the right value using curl_easy_getopt() before you call perform. A
callback is only useful if the application needs to change something while a
transfer is ongoing, which isn't the case for this option.
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-09-20