cURL / Mailing Lists / curl-library / Single Mail


Re: Incorrect HTTP range request with CURLOPT_RESUME_FROM_LARGE

From: Stephen Collyer <>
Date: Mon, 30 Jun 2008 10:45:37 +0100

Daniel Stenberg wrote:
> On Sat, 28 Jun 2008, Stephen Collyer wrote:
>> 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
> Yes, this is a clear hint that you're not building your app with the
> "proper" large file flags.

Right. I'm pretty certain this is the problem. If I hard-code a
cast to long long rather than curl_off_t, it seems to work fine,
which implies that libcurl has been built with LFS, and my app code

However, I've added _LARGEFILE_SOURCE to the appropriate defines,
and it makes no difference, though I can't see why. AFAICS, curl.h
should define curl_off_t to off_t on a POSIX system, and
 _LARGEFILE_SOURCE should ensure that off_t is 64 bit. It's not
working for some reason though.

>> One point though: isn't the format "bytes=-5248835289980310801-" an
>> illegal range request ? I wasn't expecting the leading "-" to be there.
> It looks like a problem yes and if it persists after your large file fix
> I'll be intrested in further details on how we can repeat it.

I think that this has gone away now that I've forced the offset
to a long long, but I'll check the HTTP request to make sure when
I've got the time.


Steve Collyer
Netspinner Ltd
Received on 2008-06-30