From: Sampo Niskanen

> 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.

   I'd guess that the problem could be helped (a little) by a small
change in src/http.c:

   Original:
      if (parsed == WGINT_MAX && errno == ERANGE)

   Proposed:
      if ((parsed == WGINT_MAX && errno == ERANGE) || (parsed < 0))

but if the server is sending bad data, it could easily send better
looking bad data (wrong size, but positive), and a change like this one
wouldn't help those cases.  If the server throws away data, it's
expecting too much to ask the client to do the right thing (reliably).

------------------------------------------------------------------------

   Steven M. Schweda               [EMAIL PROTECTED]
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547

Reply via email to