On Thu, Jun 10, 2021 at 6:49 AM Stephen R. van den Berg srb@cuci.nl wrote:
Chris Angelico wrote:
few months. It's not a simple fix. The default behaviour of Protocols.DNS.async_host_to_ip, which is used by Protocols.HTTP, changed from "only look up A records" to "look up AAAA and A records, and return the first AAAA if found, otherwise the first A".
In accordance to the rule that if a connection over IPv6 is possible, it should be preferred.
Unfortunately everything is built to assume that there's at most one IP address for that host name.
I'd say, the way forward should be changing the connecting functions to iterate through the IP addresses and find the first that actually connects.
Branch: rosuav/http-multi-connect
New APIs in Protocols.DNS.async_client - host_to_ips in both callback and Promise variants.
Change of behaviour in Protocols.HTTP.Query and the high level functions that call on it (eg Protocols.HTTP.get_url_data and do_async_method): All forms will now look up the name with potentially multiple results, and will attempt connections on IPv6 before IPv4 (previously, synchronous requests would prefer IPv4 unless unavailable, and async would prefer IPv6 unless unavailable).
Not merged into master as yet, but I will be using this on my own system.
Code review would be appreciated.
ChrisA