On Feb 4, 2008 4:12 AM, Micah Cowan <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Blargg wrote: > > Feature idea: when resuming (continuing) on a partially-downloaded > > file, resume slightly earlier than normal and compare with the local > > copy, to ensure that it's the same file and that the server doesn't > > handle resumption erroneously. For example, if I download the first > > 10000 bytes of a file, stop, then resume downloading the same file, > > wget starts at position 9000 and compares the first 1000 bytes it > > receives with the last 1000 bytes of the data already downloaded. The > > overlap could be configurable, and default to 1K or so. I'm always a > > bit wary when doing resumptions on file formats with no error > > correction or whose decoders hide errors, like text files or media > > streams. > > There's already a feature request to do this, in fact: > https://savannah.gnu.org/bugs/index.php?20330 > > The reason for the option was that some broken proxies will insert a > stupid "Connection lost" message when they lose connection to the remote > host, turning the results into garbage. :(
Does this need to be an option? Say we *always* re-download the last 8 bytes. This is less data than it takes to specify a single IPv6 address, so the performance impact would be negligible. Yet 8 bytes would be plenty to differentiate between: * A "Connection lost" message from compressed data. * Two unrelated files with the same name, e.g. - Sourceforge has two "foobar.tar.gz" files for each project, one is an HTML file that links to the real tar file. * Files like 'log.gz' which might be replaced between downloads * A pair of your 'average' uncompressed/plain text files. As the Gnome team team mentions, more options means more code complexity and more things to test. While in general I personally prefer more options to less, there is no point having a "do not check" option if nobody uses it. Who would use it? I can only think of four groups: 1) People who rely on wget allowing them to combine different files. 2) People who don't care if their files are corrupt. 3) Legacy systems that rely on wget not checking, and might misbehave if wget started outputting unexpected errors. 4) People who resume downloads of large numbers files, downloading only a few bytes at a time, and don't want to waste even a few percent of their bandwidth. Do such people exist? Am I missing some other group of people who would use this option? If this to be an option, I would suggest that checking the last several bytes would be the default. The people who don't know they need to check are the people who most need this feature. > I'm not sure it's that useful for other situations: if the last 1K or so > can become corrupted, something in the middle can be as well... > > I've got too many bigger things to think about to spend much time on the > plethora of little nice-to-haves like this until after 1.12 is released; > but as always, patches are quite welcome. :) -- John C. McCabe-Dansted PhD Student University of Western Australia
