-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http fails on 416 when resuming #10521
Comments
It appears nginx returns: This seems to fix this issue, but I am not entirely sure if this is the best way to fix it:
Comments are welcome. |
416 Requested Range Not Satisfiable returned by some HTTP daemons (nginx at least) appear to include Content-Range header. This confuses curl and makes it think that the whole file needs to be downloaded again, resulting in download failure when in fact the while file has already been downloaded. This change makes curl disregard Content-Range header on a 416 response, allowing other existing logic consider the file fully downloaded. Fixes curl#10521
I run into this problem as well. I tried running The server replies with
and curl fails (exit code 22). As I am not familiar with the curl codebase, I have problems reviewing the change in #10644 and do not yet understand what is the problem with it. |
I did this
On git master,
curl --fail -O -C - http://host/file
when the localfile
had already been completely downloaded.Server response:
I expected the following
curl exits with code 0 (no error, even with
--fail
), because inhttp_should_fail()
:curl/lib/http.c
Lines 1161 to 1167 in 3027611
However, when the requested range was unsatisfied (e.g.,
Content-Range: */1234567
),data->state.resume_from
is overwritten with0
(see line 3479), and thus the check above always fail.curl/lib/http.c
Lines 3452 to 3480 in 3027611
The text was updated successfully, but these errors were encountered: