aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-06 13:37:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-10-06 13:37:12 +0000
commit9a2aed7d7ac2f8fbb79fe411b3b01d8a60f0c726 (patch)
tree3db9f63a9c500220fe9cc34c1fe1fe1d8267f5f1 /lib/transfer.c
parenta91a75355d863e6aeb849f0de9169234217990bc (diff)
Chih-Chung Chang reported that if you use CURLOPT_RESUME_FROM and enabled
CURLOPT_FOLLOWLOCATION, libcurl reported error if a redirect happened even if the new URL would provide the resumed file. Test case 188 added to verify the fix (together with existing test 99).
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 7f7211048..935e2cb8e 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -488,20 +488,12 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if (conn->resume_from &&
!k->content_range &&
- (data->set.httpreq==HTTPREQ_GET)) {
- if(k->httpcode == 416) {
- /* "Requested Range Not Satisfiable" */
- stop_reading = TRUE;
- }
- else {
- /* 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) */
- failf (data, "HTTP server doesn't seem to support "
- "byte ranges. Cannot resume.");
- return CURLE_HTTP_RANGE_ERROR;
- }
+ (data->set.httpreq==HTTPREQ_GET) &&
+ (k->httpcode == 416)) {
+ /* "Requested Range Not Satisfiable" */
+ stop_reading = TRUE;
}
+
#ifndef CURL_DISABLE_HTTP
if(!stop_reading) {
/* Curl_http_auth_act() checks what authentication methods
@@ -956,6 +948,17 @@ CURLcode Curl_readwrite(struct connectdata *conn,
k->ignorebody = TRUE;
infof(data, "Ignoring the response-body\n");
}
+ if (conn->resume_from && !k->content_range &&
+ (data->set.httpreq==HTTPREQ_GET) &&
+ !k->ignorebody) {
+ /* 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) */
+ failf (data, "HTTP server doesn't seem to support "
+ "byte ranges. Cannot resume.");
+ return CURLE_HTTP_RANGE_ERROR;
+ }
+
if(data->set.timecondition && !conn->range) {
/* A time condition has been set AND no ranges have been
requested. This seems to be what chapter 13.3.4 of