cURL / Mailing Lists / curl-library / Single Mail

curl-library

Incorrect HTTP range request with CURLOPT_RESUME_FROM_LARGE

From: Stephen Collyer <scollyer_at_netspinner.co.uk>
Date: Fri, 27 Jun 2008 14:54:51 +0100

I'm using libcurl 7.16.4 on an opensuse 10.3 box.

I'm trying to perform an HTTP GET with a range request with
code like the following:

> curl_easy_setopt(curl_, CURLOPT_URL, curl_url);
>
> curl_easy_setopt(curl_, CURLOPT_WRITEFUNCTION, write_callback);
> curl_easy_setopt(curl_, CURLOPT_WRITEDATA, &file);
>
> curl_easy_setopt(curl_, CURLOPT_PROGRESSFUNCTION, download_progress_callback);
> curl_easy_setopt(curl_, CURLOPT_PROGRESSDATA, &progress_cb_);
> curl_easy_setopt(curl_, CURLOPT_NOPROGRESS, 0);
>
> // set the initial offset from which to resume, if necessary
>
> if (startbyte)
> {
> curl_easy_setopt(curl_, CURLOPT_RESUME_FROM_LARGE, (curl_off_t) startbyte);
> }

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 ?

-- 
Regards
Steve Collyer
Netspinner Ltd
Received on 2008-06-27