diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-01-27 18:57:07 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-01-27 18:57:07 +0000 |
commit | 3a8210c975fd829f00e43f87974d51e3d6b12410 (patch) | |
tree | 0623a18d7b2aff0795d430c545314cacb057cc60 /lib | |
parent | d69302202d6c7a94a0e4f3ed81d7947705f9dc83 (diff) |
Resume is now done with a Content-Range header instead of a Range header if
the request isn't GET. Presumably, this is how it should be made.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c index a9b9c5d97..7553b613b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -429,8 +429,21 @@ CURLcode Curl_http(struct connectdata *conn) } } } - if((data->bits.set_range) && !checkheaders(data, "Range:")) { - data->ptr_rangeline = aprintf("Range: bytes=%s\015\012", data->range); + if(data->bits.set_range) { + /* + * A range is selected. We use different headers whether we're downloading + * or uploading and we always let customized headers override our internal + * ones if any such are specified. + */ + if((data->httpreq == HTTPREQ_GET) && + !checkheaders(data, "Range:")) { + data->ptr_rangeline = aprintf("Range: bytes=%s\015\012", data->range); + } + else if((data->httpreq != HTTPREQ_GET) && + !checkheaders(data, "Content-Range:")) { + data->ptr_rangeline = aprintf("Content-Range: bytes=%s\015\012", + data->range); + } } if((data->bits.http_set_referer) && !checkheaders(data, "Referer:")) { data->ptr_ref = aprintf("Referer: %s\015\012", data->referer); |