]> granicus.if.org Git - curl/commitdiff
mr Khristophorov added support for lame web servers sending bad range
authorDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2000 07:15:41 +0000 (07:15 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2000 07:15:41 +0000 (07:15 +0000)
headers...

lib/highlevel.c

index aeaa81a70e289dcf060a3929fb6d30b65f59c044..da3f4c94b61a35e48cfbb5e13e2b9e0255543abd 100644 (file)
@@ -375,11 +375,16 @@ _Transfer(struct connectdata *c_conn)
               if (strnequal("Content-Length", p, 14) &&
                   sscanf (p+14, ": %ld", &contentlength))
                 conn->size = contentlength;
-              else if (strnequal("Content-Range", p, 13) &&
-                       sscanf (p+13, ": bytes %d-", &offset)) {
-                if (data->resume_from == offset) {
-                  /* we asked for a resume and we got it */
-                  content_range = TRUE;
+              else if (strnequal("Content-Range", p, 13)) {
+                if (sscanf (p+13, ": bytes %d-", &offset) ||
+                    sscanf (p+13, ": bytes: %d-", &offset)) {
+                  /* This second format was added August 1st by Igor
+                     Khristophorov since Sun's webserver JavaWebServer/1.1.1
+                     obviously sends the header this way! :-( */
+                  if (data->resume_from == offset) {
+                    /* we asked for a resume and we got it */
+                    content_range = TRUE;
+                  }
                 }
               }
               else if(data->cookies &&