cURL / Mailing Lists / curl-library / Single Mail


Re: Incorrect HTTP range request with CURLOPT_RESUME_FROM_LARGE

From: Stephen Collyer <>
Date: Sat, 28 Jun 2008 11:43:19 +0100

Tor Arntsen wrote:
> On Fri, Jun 27, 2008 at 3:54 PM, Stephen Collyer
> <> wrote:
>> startbyte is an unsigned long long. When this code runs with
>> startbyte set to 3173103, curl emits a range request like:
>>> Range: bytes=-5248835289980310801-
>> Can anyone suggest what is being screwed up here ?
> 3173103 is 0x306aef in hex.
> That very long number above is 0xb728641d00306aef in hex. The latter 4
> bytes are the same as your actual number, as you can see.. Seems to be
> a type problem somewhere, like if a location stored as 4-byte int is
> read as an 8-byte long long on a little-endian host.

Thanks. That's an interesting observation. I'm beginning to think
that it's something to do with my build options. In my app. code.
sizeof(curl_off_t) is 4, which is clearly screwy for

I'm not sure what the installed curl libs are built with - is
there any easy way to find out ?

I've taken a look at curl/curl.h and it seems that I need to
build with large file support to get a suitable curl_off_t.
I think that could be the problem.

One point though: isn't the format "bytes=-5248835289980310801-"
an illegal range request ? I wasn't expecting the leading "-"
to be there.

Steve Collyer
Netspinner Ltd
Received on 2008-06-28