cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] --ignore-content-length

From: Toby Peterson <toby_at_opendarwin.org>
Date: Tue, 23 Aug 2005 16:44:37 -0700

On Aug 23, 2005, at 3:13 PM, Daniel Stenberg wrote:

> On Tue, 23 Aug 2005, Toby Peterson wrote:
>
>> Here's a fairly simple patch (against HEAD) to add a --ignore-
>> content-length option, and corresponding
>> CURLOPT_IGNORE_CONTENT_LENGTH. This will make it easier to
>> download files from Apache 1.x servers that are (still!) serving
>> files larger than 4 GB.
>>
>
> So the Content-Length: header of such a file on such a server is
> completely bogus?

Right, Apache 1.x uses a signed 32-bit int for the Content-Length...
and has to, in order to maintain binary compatibility. So, for
example, libcurl will only download the first 200 MB of a 4.2 GB
file, because Apache reports that as the Content-Length.

> Out of curiousity, how are you using this option? Are you always
> enabling this (and won't that be bad?) or have you found a way to
> detect this badness and then retry the request?

It's not enabled by default - the user must explicitly specify it, as
there is no way (that I can see) to automatically determine that the
server is stupid. Can't trust the Server header these days...

I know this seems pretty random, but I get a *lot* of complaints
about this; apparently a lot of Mac OS X users have to deal with
large files and Apache 1.x!

- Toby
Received on 2005-08-24