mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
changed order of the range and follow-location checks so that a range-request
will work even when following a Location:
This commit is contained in:
parent
e721f85c83
commit
1bcd3e601a
@ -444,7 +444,12 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
write a chunk of the body */
|
write a chunk of the body */
|
||||||
if(conn->protocol&PROT_HTTP) {
|
if(conn->protocol&PROT_HTTP) {
|
||||||
/* HTTP-only checks */
|
/* HTTP-only checks */
|
||||||
if (data->resume_from &&
|
if (data->newurl) {
|
||||||
|
/* abort after the headers if "follow Location" is set */
|
||||||
|
infof (data, "Follow to new URL: %s\n", data->newurl);
|
||||||
|
return CURLE_OK;
|
||||||
|
}
|
||||||
|
else if (data->resume_from &&
|
||||||
!content_range &&
|
!content_range &&
|
||||||
(data->httpreq==HTTPREQ_GET)) {
|
(data->httpreq==HTTPREQ_GET)) {
|
||||||
/* we wanted to resume a download, although the server
|
/* we wanted to resume a download, although the server
|
||||||
@ -454,11 +459,6 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
"byte ranges. Cannot resume.");
|
"byte ranges. Cannot resume.");
|
||||||
return CURLE_HTTP_RANGE_ERROR;
|
return CURLE_HTTP_RANGE_ERROR;
|
||||||
}
|
}
|
||||||
else if (data->newurl) {
|
|
||||||
/* abort after the headers if "follow Location" is set */
|
|
||||||
infof (data, "Follow to new URL: %s\n", data->newurl);
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
|
||||||
else if(data->timecondition && !data->range) {
|
else if(data->timecondition && !data->range) {
|
||||||
/* A time condition has been set AND no ranges have been
|
/* A time condition has been set AND no ranges have been
|
||||||
requested. This seems to be what chapter 13.3.4 of
|
requested. This seems to be what chapter 13.3.4 of
|
||||||
|
Loading…
Reference in New Issue
Block a user