Resume does not interact well with --fail #6740
I have a script that is designed to allow the user to invoke it again in the event that something fails, while also trying to avoid redoing work that has already been completed when that happens. As part of that:
Unfortunately, when curl tries to resume a completed download, it gets a '416 Range Not Satisfiable' HTTP error, which causes curl to exit with an error instead of skipping the completed download.
I know that curl has code to specially handle 416, but I guess it's not handling this case correctly.
Perhaps curl could make a HEAD request before trying to resume a download, and check whether the returned
Or if that's tricky, perhaps curl could trim a byte from the end of any pre-existing file before trying to resume it, which would again avoid the 416 in the case the file was complete.
curl 7.71.1 (x86_64-redhat-linux-gnu) libcurl/7.71.1 OpenSSL/1.1.1j-fips zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.9.5/openssl/zlib nghttp2/1.43.0
The text was updated successfully, but these errors were encountered:
When asked to resume a download, libcurl will convert that to HTTP logic and if then the entire file is already transferred it will result in a 416 response from the HTTP server. With CURLOPT_FAILONERRROR set in that scenario, it should *not* lead to an error return. Updated test 1156, added test 1273 Reported-by: Jonathan Watt Fixes #6740 Closes #