mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:33:31 +03:00
http: make 416 not fail with resume + CURLOPT_FAILONERRROR
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 #6753
This commit is contained in:
parent
e8e7ef3612
commit
6d176bee59
5 changed files with 110 additions and 21 deletions
|
|
@ -1094,6 +1094,14 @@ static bool http_should_fail(struct Curl_easy *data)
|
|||
if(httpcode < 400)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
** A 416 response to a resume request is presumably because the file is
|
||||
** already completely downloaded and thus not actually a fail.
|
||||
*/
|
||||
if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
|
||||
httpcode == 416)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
** Any code >= 400 that's not 401 or 407 is always
|
||||
** a terminal error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue