cURL cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1443 Absence of facultative Content-Range crash my script

From: hugo <hugolpz_at_users.sf.net>
Date: Fri, 07 Nov 2014 17:15:09 +0000

Daniel, when will this bug-fix will be published to the ubuntu packages ?

---
** [bugs:#1443] Absence of facultative Content-Range crash my script**
**Status:** closed-fixed
**Labels:** Content-range 
**Created:** Wed Oct 29, 2014 08:43 PM UTC by hugo
**Last Updated:** Sat Nov 01, 2014 10:10 PM UTC
**Owner:** Daniel Stenberg
The addition of Content-Range in HTTP 416 responses is optional per RFC 2616. But curl bug if it is not present.

----

    :::bash
    #306MB file
    curl -L -C - 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registe%e2%80%8c%e2%80%8bred/netcdf/readme_etopo1_netcdf.txt' -o ./data/countries.zip  
    #1.1kB file
    curl -L -C - 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registe%e2%80%8c%e2%80%8bred/netcdf/readme_etopo1_netcdf.txt' -o ./data/texte.txt

The target server definitively accepts to resume unfinished download. However, when 
the download is already finished and the curl request is sent again, curl crash my script and drop back the error message :

“Curl : (33) HTTP server doesn't seem to support byte ranges. Cannot resume.”

It actually should rather notice the completeness and send a success message.

The bug occurs with the ngdc.noaa.gov website. 

With Wireshark I checked what is going on in the HTTP protocol. Basically, when curl makes the request to resume the completed file, the server sends back an HTTP 416 error ("Requested Range Not Satisfiable"). In the case of naturalearthdata.com, the CDN they use adds a Content-Range header specifying the exact length of the file. ngdc.noaa.gov does not add this header. Note that the addition of Content-Range in HTTP 416 responses is optional per RFC 2616.

curl uses Content-Range to determine if the download is complete. If the header is missing, curl assumes that the server doesn't support range downloads and spits out that error message.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-11-07

These mail archives are generated by hypermail.