cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: BUG: HTTP server doesn't seem to support byte ranges. Cannot resume.

From: Fabian Keil <freebsd-listen_at_fabiankeil.de>
Date: Thu, 4 Apr 2013 13:04:22 +0200

sdrfnord <sdrfnord_at_gmx.de> wrote:

> On 04.04.2013 12:18, Fabian Keil wrote:
> > sdrfnord <sdrfnord_at_gmx.de> wrote:
> >
> >> I noticed a problem with curl. When a file is already downloaded completely and
> >> curl is executed again using -C - then curl says "curl: (33) HTTP server doesn't
> >> seem to support byte ranges. Cannot resume."
> >>
> >> I don't think that this is the intended behaviour. Wget does notice that the
> >> file is already complete.
> >
> > Does wget get different headers from the server?
> >
> > I think it could be argued that curl's message isn't as precise
> > as it could be, but the "Cannot resume" part seems correct to me.
>
> My problem is the exit status. I mean everything worked perfect. The file is
> completely downloaded and curl returns an exit status not equal to 0 ...
>
> $ curl -C - http://www.heise.de/icons/ho/bilderstrecke.png -o bilderstrecke.png

This is a different URL and the server behaves differently:

fk@r500 ~ $curl --silent -v -C - http://www.heise.de/icons/ho/bilderstrecke.png -o bilderstrecke.png
* STATE: INIT => CONNECT handle 0x801ca7088; line 1001 (connection #-5000)
* About to connect() to proxy 10.0.0.1 port 8118 (#0)
* Trying 10.0.0.1...
* Adding handle: conn: 0x801cdb608
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* 0x801c3f008 is at send pipe head!
* - Conn 0 (0x801cdb608) send_pipe: 1, recv_pipe: 0
* STATE: CONNECT => WAITCONNECT handle 0x801ca7088; line 1048 (connection #0)
* Connected to 10.0.0.1 (10.0.0.1) port 8118 (#0)
* STATE: WAITCONNECT => DO handle 0x801ca7088; line 1167 (connection #0)
> GET http://www.heise.de/icons/ho/bilderstrecke.png HTTP/1.1
> Range: bytes=1267-
> User-Agent: curl/7.30.0-DEV
> Host: www.heise.de
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* STATE: DO => DO_DONE handle 0x801ca7088; line 1253 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x801ca7088; line 1370 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x801ca7088; line 1381 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 416 Requested Range Not Satisfiable
< Date: Thu, 04 Apr 2013 10:59:07 GMT
* Server Apache is not blacklisted
< Server: Apache
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=iso-8859-1
< Proxy-Connection: keep-alive
<
* HTTP server doesn't seem to support byte ranges. Cannot resume.
* Closing connection 0
* The cache now contains 0 members

Again it could be argued that a more precise error message could be
used, but I don't agree that everything "worked perfectly" and don't
think curl should treat this as a successful transfer.

Fabian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2013-04-04