Hi,

While downloading a 12GB file, I noticed that wget (version 1.10.2) crashed when trying to download it. After examining it a bit, I discovered that the Apache server falsely sends the header "Content-Length: -649674338" (the truncated 32-bit signed value of the true length). When using --ignore-length the file is retrieved normally.

If the length given by the server is negative (i.e. surely bogus), wget should automatically ignore it (with a possible warning message), not crash.


Additionally it would be great if wget could correctly detect if the content is actually larger than implied in the headers. If the truncated file size is positive, wget would probably silently just download a piece of the file (I haven't been able to test this in practise, but I'd guess this to be the case). This could be done by attempting to download more data than the Content-Length specifies, and see if any extra is available. It may be questionable to save more data than specified in the headers, but at any rate wget could print out a warning message suggesting the usage of --ignore-length.


--
  __________________________________________________
 /____\   Sampo Niskanen <=> [EMAIL PROTECTED]  \
       \       http://www.iki.fi/sampo.niskanen/     \
        \     ________________________________________\___
         \___/___________________________________________/

Reply via email to