Bernhard Kuemel <[EMAIL PROTECTED]> writes:

> Can anyone explain why this fails? I test interrupt the download and
> then try to resume it with -c.

Because Sun's "JavaWebServer/1.1.1" is broken.  If you use `-d',
you'll notice that it sends the Content-Range header like this:

    Content-Range: bytes: 644312-124582823/124582824

The second ":" is illegal; it should be:

    Content-Range: bytes 644312-124582823/124582824

The following patch makes Wget deal with the incorrect header.


2001-11-29  Hrvoje Niksic  <[EMAIL PROTECTED]>

        * http.c (http_process_range): Accept the broken output of
        "JavaWebServer/1.1.1".

Index: src/http.c
===================================================================
RCS file: /pack/anoncvs/wget/src/http.c,v
retrieving revision 1.74
diff -u -r1.74 http.c
--- src/http.c  2001/11/26 12:51:25     1.74
+++ src/http.c  2001/11/29 13:49:26
@@ -202,6 +202,10 @@
   if (!strncasecmp (hdr, "bytes", 5))
     {
       hdr += 5;
+      /* "JavaWebServer/1.1.1" sends "bytes: x-y/z", contrary to the
+        HTTP spec. */
+      if (*hdr == ':')
+       ++hdr;
       hdr += skip_lws (hdr);
       if (!*hdr)
        return 0;

Reply via email to