summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-01-30 11:52:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-01-30 11:52:59 +0000
commit1bcd3e601a2e184295145687a9b8ae8e1ebd46ad (patch)
tree010e307ddd9a37bcf59a2e15853a10e0f274df4b
parente721f85c83d787bdc85c6c9e3971fd8b324902df (diff)
downloadgnurl-1bcd3e601a2e184295145687a9b8ae8e1ebd46ad.tar.gz
gnurl-1bcd3e601a2e184295145687a9b8ae8e1ebd46ad.tar.bz2
gnurl-1bcd3e601a2e184295145687a9b8ae8e1ebd46ad.zip
changed order of the range and follow-location checks so that a range-request
will work even when following a Location:
-rw-r--r--lib/transfer.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 0099297dc..09c1262cb 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -444,9 +444,14 @@ _Transfer(struct connectdata *c_conn)
write a chunk of the body */
if(conn->protocol&PROT_HTTP) {
/* HTTP-only checks */
- if (data->resume_from &&
- !content_range &&
- (data->httpreq==HTTPREQ_GET)) {
+ 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 &&
+ (data->httpreq==HTTPREQ_GET)) {
/* 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) */
@@ -454,11 +459,6 @@ _Transfer(struct connectdata *c_conn)
"byte ranges. Cannot resume.");
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) {
/* A time condition has been set AND no ranges have been
requested. This seems to be what chapter 13.3.4 of