wget2
wget2 copied to clipboard
No ipv4 fallback when ipv6 connection does not work
When fetching something with wget2 that is only reachable via IPv4, by default wget tries IPv6 and then fails. I think that it would be good to have an IPv4 fallback similar to what wget1 used to have.
Example:
# wget2 -t1 http://www.spinics.net/lists/linux-mm/attachments//gtarazbJaHPaAT.gtar
Failed to send 252 bytes (hostname='www.spinics.net', ip=2604:9a00:2010:a03b:4::114, errno=113)
[Files: 0 Bytes: 0 [0 B/s] Redirects: 0 Todo: 0 Errors: 0 ]
Same example with wget1:
# wget -t1 http://www.spinics.net/lists/linux-mm/attachments//gtarazbJaHPaAT.gtar
--2024-06-26 10:01:51-- http://www.spinics.net/lists/linux-mm/attachments//gtarazbJaHPaAT.gtar
Resolving www.spinics.net (www.spinics.net)... 2604:9a00:2010:a03b:4::114, 207.244.127.203
Connecting to www.spinics.net (www.spinics.net)|2604:9a00:2010:a03b:4::114|:80... failed: No route to host.
Connecting to www.spinics.net (www.spinics.net)|207.244.127.203|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.spinics.net/lists/linux-mm/attachments//gtarazbJaHPaAT.gtar [following]
--2024-06-26 10:01:51-- https://www.spinics.net/lists/linux-mm/attachments//gtarazbJaHPaAT.gtar
Connecting to www.spinics.net (www.spinics.net)|207.244.127.203|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19817 (19K) [application/x-gtar]
Saving to: ‘gtarazbJaHPaAT.gtar’
gtarazbJaHPaAT.gtar 100%[================================================>] 19.35K --.-KB/s in 0.008s
2024-06-26 10:01:51 (2.37 MB/s) - ‘gtarazbJaHPaAT.gtar’ saved [19817/19817]
Also the output of that in wget2 could be a bit more detailed. errno=113 does not really say much about what the problem is.