> My point is that adding a callback doesn't fix anything on its own. An 
> application would need to add a function to be called back, and so far, your 
> application is the only one that would currently use it. I suspect there > is 
> a better way to solve this issue.  For example, you didn't answer this 
> question from my last message:

 > If Curl_ipv6works() were not called in the CURL_IPRESOLVE_V6 case, would
 > that solve the issues that are remaining?

Your question was:
"So, if libcurl eliminated that call in the CURL_IPRESOLVE_V4 case, would it 
fix your problem?"

And I answered that question:
" Daniel's PR fixed the issue only for CURL_IPRESOLVE_V4, but not for 
CURL_IPRESOLVE_WHATEVER and CURL_IPRESOLVE_IPV6."

So, my problems will NOT be fixed if libcurl eliminated the If Curl_ipv6works() 
call in the CURL_IPRESOLVE_V4 case.
The problems remain for CURL_IPRESOLVE_WHATEVER and CURL_IPRESOLVE_IPV6 modes.

YES, adding a callback doesn't fix anything on its own. But it allows curl 
applications to work around problems/regressions caused by default 
Curl_ipv6works() behavior.
Maybe, there is a better way to fix this issue, but I don't think it is 
possible to provide the "IP6 works" function which works for ALL possible cases 
- thus there is a need for customization.

For instance, curl application may implement the "IPv6 works" callback based on 
some atomic variable, which is a magnitude faster than the socket system call 
done in the Curl_ipv6works().

And libcurl provides memory callbacks in a similar fashion, which can optimize 
memory allocations for some applications.
I guess whoever proposed memory callbacks also faced arguments like "your 
application is the only one that would currently use it.", which can be said 
about any new feature. 😊

Thanks,
Dmitry  Karpov


-----Original Message-----
From: curl-library <[email protected]> On Behalf Of Dan 
Fandrich via curl-library
Sent: Wednesday, September 21, 2022 3:59 PM
To: libcurl development <[email protected]>
Cc: Dan Fandrich <[email protected]>
Subject: Re: [EXTERNAL] Re: Feature request: provide ability to set a global 
callback function telling libcurl if IPv6 works on the system

On Wed, Sep 21, 2022 at 10:46:45PM +0000, Dmitry Karpov via curl-library wrote:
> I think that my proposal will provide useful customization for dual-stack 
> curl applications, and I am not sure that I fully understand your objections 
> like " It might in your situation, but it wouldn't in everybody else's.".

My point is that adding a callback doesn't fix anything on its own. An 
application would need to add a function to be called back, and so far, your 
application is the only one that would currently use it. I suspect there is a 
better way to solve this issue.  For example, you didn't answer this question 
from my last message:

  If Curl_ipv6works() were not called in the CURL_IPRESOLVE_V6 case, would
  that solve the issues that are remaining?

Since you're calling it a regression, then where did that regression occur? Was 
it in libcurl or in the kernel? Maybe this problem needs to be solved elsewhere.

Dan
--
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