cURL / Mailing Lists / curl-library / Single Mail

curl-library

http resume, libcurl ignoring the 206 status code.

From: Nathan E. Moore <nate_at_redtetrahedron.org>
Date: Sat, 03 Mar 2007 05:27:27 -0500

When sending a range request to a http server libcurl only looks for a
Content-Range header in the response. If this header is not present a
error is issued and the download aborted. Even if the server responded
with a 206 response code, and actually send the requested ranges.

Nothing in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
indicates that a Content-Range header is required for a partial content
response. By my reading of it the header is only required to not be a *
with a 206.

I have only tried so far using the CURLOPT_RESUME_FROM option. I suppose
there is a chance that setting the range request using CURLOPT_HTTPHEADER
may work around libcurl's checks, and I will try that tomorrow.

I don't have a public url that exhibits this behavior or I would provides
for others to test with.

Nathan Moore
Received on 2007-03-03