> I don't see your argument. Either you want IPv6 for a connection or you don't.

Yes, I want to use dual-stack in general. That's why my application has 
numerous components which use CURLOPT_IPRESOLVE = AUTO.
But if IPv6 doesn't work on a "system level", I want my curl code to be as fast 
as "IPv4 only" resolve mode without changing anything in my code - like doing 
detection that IPv6 doesn't work and modifying IP resolve mode in all the 
places where I create and set an easy handle (that's your suggestion as I 
understood it).

In other words, I want benefits of dual-stack when it works, and I don't want 
to pay any performance penalties when it doesn't.
And I also don't want to pay code change penalties to modify CURLOPT_IPRESOLVE 
to IPv4 for cases when IPv6 doesn't work in ALL the places where easy handles 
are created and set up.

> . A callback is only useful if the application needs to change something 
> while a transfer is ongoing

The callback I am proposing is a global application callback, not a 
transfer-specific callback which, indeed, is needed only for 
transfer-in-progress operations.

My callback will be set when application initializes curl via 
curl_global_init_ipv6() function, and it will be used when a multi handle is 
created (and before any easy handles are added to it) to set "IPv6 works" mode 
for the multi-handle .

This is very similar to what Curl_ipv6works() currently does, only my proposal 
will allow to use application-specific function instead of Curl_ipv6works().

Thanks,
Dmitry  Karpov

-----Original Message-----
From: curl-library <curl-library-boun...@lists.haxx.se> On Behalf Of Dan 
Fandrich via curl-library
Sent: Tuesday, September 20, 2022 12:58 PM
To: libcurl development <curl-library@lists.haxx.se>
Cc: Dan Fandrich <d...@coneharvesters.com>
Subject: Re: [EXTERNAL] Re: Feature request: provide ability to set a global 
callback function telling libcurl if IPv6 works on the system

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
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to