curl / Mailing Lists / curl-library / Single Mail


Re: cURL behaviour when Content-Length is unrepresentable and a max file size is set

From: Daniel Stenberg <>
Date: Tue, 9 Jan 2018 05:29:45 +0100 (CET)

On Wed, 3 Jan 2018, Brad Spencer wrote:

>> Recent? I tracked down the parsing using integer back to 2005 and I
>> can't recall it using anything else before that either...
> AFAIK, until recently, the file sizes were reported through the API as
> doubles via CURLINFO_CONTENT_LENGTH_DOWNLOAD. My memory is fuzzy here, but
> I thought I used to see very large Content-Length values come all the way
> through this API as doubles even when they didn't fit into curl_off_t.
> Sorry if I made things confusing here.

Ah right. Now I get you. Yes it was parsed as integer but exported as a double
for some old stupid reason, but that's now in the past!

> I've been running with a small local change that implements the "abort on
> unrepresentable size when a limit is set" behaviour and it's been doing the
> trick for me. It sounds like there are a few collateral changes that you've
> identified here; they make sense to me too, FWIW.

Please give my new PR for this a look and see if it matches your world view:

Thanks for your attention to these details!

Received on 2018-01-09