Re: wget 1.10.x: New option --random to randomize the dns result
Hrvoje Niksic <[email protected]> Tue, 18 Apr 2006 15:27:46 +0200
| Newsgroups | gmane.comp.web.wget.patches |
|---|---|
| Message-ID | <[email protected]> |
Jerry Lundstr=F6m <[email protected]> writes: > As getaddrinfo() sorts the dns result no matter if its ipv4 or ipv6 > you will be resolved to the same server 99.9% of the time. I wished > there was a flag to getaddrinfo() so that you simply could turn off > the RFC 3484 behaviour but there isnt. I understand what the option does, but I don't understand what value it brings to the end user of Wget. Wget is already capable of reconnecting to the next address in the list if the first one fails (and not use the one that failed during the same Wget run). I'm trying to imagine which users would ever want to use this option and on what grounds, and I can't come up with a plausible scenario. > Mirroring scripts, dists and other things that use wget might not > always like getting the same ip address over and over again. I am a > Lunar Linux developer (www.lunar-linux.org) and we use wget for > fetching sources and RFC 3484 breaks our mirrors before they are > synced. Do you mean that the first address in the list is malfunctioning? Shouldn't Wget then fall back to the next one? If one of the addresses is malfunctioning, even with --random you could still get that address, right? Also, unless I'm missing something, shuffling the addresses at the point at which you do it interferes with the --prefer-ipv[46] options. >> Anyway, it's a better idea to add a generic shuffle() code to, say, >> utils.c, and just call it from host.c. > > Didn't want to mess the struct up before it was done I don't understand this. Is there a failure mode in which the shuffle could fail to complete? If there is no allocation, I cannot imagine any. Thanks for sharing this patch with us. I don't speak for Mauro, but so far I am unconvinced that it should become part of Wget.