resume: consider a resume from [content-length] to be OK
Basically since servers often then don't respond well to this and instead send the full contents and then libcurl would instead error out with the assumption that the server doesn't support resume. As the data is then already transfered, this is now considered fine. Test case 1434 added to verify this. Test case 1042 slightly modified. Reported-by: hugo Bug: http://curl.haxx.se/bug/view.cgi?id=1443
This commit is contained in:
@@ -547,6 +547,18 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
||||
if(data->state.resume_from && !k->content_range &&
|
||||
(data->set.httpreq==HTTPREQ_GET) &&
|
||||
!k->ignorebody) {
|
||||
|
||||
if(k->size == data->state.resume_from) {
|
||||
/* The resume point is at the end of file, consider this fine
|
||||
even if it doesn't allow resume from here. */
|
||||
infof(data, "The entire document is already downloaded");
|
||||
connclose(conn, "already downloaded");
|
||||
/* Abort download */
|
||||
k->keepon &= ~KEEP_RECV;
|
||||
*done = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* we wanted to resume a download, although the server doesn't
|
||||
* seem to support this and we did this with a GET (if it
|
||||
* wasn't a GET we did a POST or PUT resume) */
|
||||
|
Reference in New Issue
Block a user