aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-12-01 07:49:22 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-12-01 07:49:22 +0000
commitd8c61d459e528ead954482ac797861bce95dd895 (patch)
tree762fcf6ba6a447be39f1af998531098883e0776c /lib/transfer.c
parent7ae5ebbeb22cae2c8a04bea0c10ec0424fa6b788 (diff)
Toon Verwaest reported that there are servers that send the Content-Range:
header in a third, not suppported by libcurl, format and we agreed that we could make the parser more forgiving to accept all the three found variations.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index e3d85aee0..a40c103e1 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -904,19 +904,20 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|| checkprefix("x-compress", start))
k->content_encoding = COMPRESS;
}
- else if (Curl_compareheader(k->p, "Content-Range:", "bytes")) {
+ else if (checkprefix("Content-Range:", k->p)) {
/* Content-Range: bytes [num]-
Content-Range: bytes: [num]-
+ Content-Range: [num]-
The second format was added since Sun's webserver
JavaWebServer/1.1.1 obviously sends the header this way!
+ The third added since some servers use that!
*/
- char *ptr = Curl_strcasestr(k->p, "bytes");
- ptr+=5;
+ char *ptr = k->p + 14;
- if(*ptr == ':')
- /* stupid colon skip */
+ /* Move forward until first digit */
+ while(*ptr && !ISDIGIT(*ptr))
ptr++;
k->offset = curlx_strtoofft(ptr, NULL, 10);