> That user had an application that wanted to first create an IPv4 (-only) 
> connection and then an IPv6 (-only) one (separately from the previous 
> connection). That requires that the DNS cache keeps both families even if
> I presume this is what causing you problems?

Yes, the unconditional "dual-stack" approach for DNS queries regardless the 
transfer resolve mode is causing the problems.
I continue stepping on occasions when DNS servers handle IPv6 queries much 
worse than IPv4.
Unfortunately, IPv6 is still quite frequently overlooked by some ISPs and it is 
not always tuned properly.

And in the cases when they didn't respond on IPv6 queries (but responded OK on 
IPv4 ones) IPv4-only requests failed with timeouts.
In the other cases, when IPv6 DNS responses came with delays, they negatively 
affected transfer performance increasing transfer start time.
That was an unexpected regression going from IPv4 only libcurl to IPv6-enabled 
one for IPv4-only requests.

I understand the rationale for keeping DNS entry in the cache for both 
addresses, but in my proposal, I suggest to use "dual-stack" DNS queries only 
for dual-stack and IPv6-only modes.
This will make IPv4-only requests in IPv6-enabled libcurl builds behave the 
same way as they do in IPv4-only builds.


-----Original Message-----
From: Daniel Stenberg <dan...@haxx.se> 
Sent: Friday, May 20, 2022 7:14 AM
To: Dmitry Karpov via curl-library <curl-library@lists.haxx.se>
Cc: Dmitry Karpov <dkar...@roku.com>
Subject: Re: IPv6 resolution problems for IPv4 resolve mode

On Mon, 9 May 2022, Dmitry Karpov via curl-library wrote:

> If this approach is agreed upon, I have implementation for these 
> changes and can create a PR.

The most recent change in this area that I can recall introduced the 
unconditional request for both families even if you ask for IPv4 or IPv6 
specifically for a specific reason: The DNS cache.

That user had an application that wanted to first create an IPv4 (-only) 
connection and then an IPv6 (-only) one (separately from the previous 
connection). That requires that the DNS cache keeps both families even if the 
transfer itself is done using only one of them.

I presume this is what causing you problems?

-- 

  / 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.haxx.se/mail/etiquette.html

Reply via email to