Send Content-Length: with Content-Range:. (Christoph Lohmann) [rsc] --rw-rw-r-- M 1401567 glenda sys 12264 Oct 13 07:23 sys/src/cmd/ip/httpd/sendfd.c /n/sourcesdump/2005/1013/plan9/sys/src/cmd/ip/httpd/sendfd.c:125,133 - /n/sourcesdump/2005/1014/plan9/sys/src/cmd/ip/httpd/sendfd.c:125,134 r = c->head.range; if(r == nil) hprint(hout, "Content-Length: %lld\r\n", length); - else if(r->next == nil) + else if(r->next == nil){ hprint(hout, "Content-Range: bytes %ld-%ld/%lld\r\n", r->start, r->stop, length); - else{ + hprint(hout, "Content-Length: %ld\r\n", r->stop - r->start); + }else{ multir = 1; boundary = hmkmimeboundary(c); hprint(hout, "Content-Type: multipart/byteranges; boundary=%s\r\n", boundary); /n/sourcesdump/2005/1013/plan9/sys/src/cmd/ip/httpd/sendfd.c:195,200 - /n/sourcesdump/2005/1014/plan9/sys/src/cmd/ip/httpd/sendfd.c:196,202 hprint(hout, "\r\n--%s\r\n", boundary); printtype(hout, type, enc); hprint(hout, "Content-Range: bytes %ld-%ld/%lld\r\n", r->start, r->stop, length); + hprint(hout, "Content-Length: %ld\r\n", r->stop - r->start); hprint(hout, "\r\n"); } hflush(hout); [sys] --rwxrwxr-x M 1401567 glenda sys 292482 Oct 13 23:11 386/bin/ip/httpd/httpd /sys/src/cmd/ip/httpd/sendfd.c:acceptcont /sys/src/cmd/ip/httpd/sendfd.c:checkreq /sys/src/cmd/ip/httpd/sendfd.c:notaccept /sys/src/cmd/ip/httpd/sendfd.c:printtype /sys/src/cmd/ip/httpd/sendfd.c:sendfd /sys/src/libhttpd/parse.c:getc /sys/src/libhttpd/parse.c:lex1 /sys/src/libhttpd/parse.c:mimeaccept /sys/src/libhttpd/parse.c:mimeacceptchar /sys/src/libhttpd/parse.c:mimeacceptenc /sys/src/libhttpd/parse.c:mimeacceptlang /sys/src/libhttpd/parse.c:mimeagent /sys/src/libhttpd/parse.c:mimeauthorization /sys/src/libhttpd/parse.c:mimeconnection /sys/src/libhttpd/parse.c:mimecontlen /sys/src/libhttpd/parse.c:mimeetag /sys/src/libhttpd/parse.c:mimeexpect /sys/src/libhttpd/parse.c:mimefresh /sys/src/libhttpd/parse.c:mimehfields /sys/src/libhttpd/parse.c:mimehost /sys/src/libhttpd/parse.c:mimeifrange /sys/src/libhttpd/parse.c:mimematch /sys/src/libhttpd/parse.c:mimemodified /sys/src/libhttpd/parse.c:mimenomatch /sys/src/libhttpd/parse.c:mimeok /sys/src/libhttpd/parse.c:mimeparams /sys/src/libhttpd/parse.c:mimerange /sys/src/libhttpd/parse.c:mimeranges /sys/src/libhttpd/parse.c:mimetransenc /sys/src/libhttpd/parse.c:mimeunmodified /sys/src/libhttpd/parse.c:ungetc [sys] --rwxrwxr-x M 1401567 glenda sys 131212 Oct 13 23:11 386/bin/ip/httpd/save /sys/src/cmd/ip/httpd/init.c:init /sys/src/cmd/ip/httpd/save.c:main /sys/src/cmd/ip/httpd/sendfd.c:acceptcont /sys/src/cmd/ip/httpd/sendfd.c:checkreq /sys/src/cmd/ip/httpd/sendfd.c:notaccept /sys/src/cmd/ip/httpd/sendfd.c:printtype /sys/src/cmd/ip/httpd/sendfd.c:sendfd /sys/src/libc/port/lrand.c:isrand /sys/src/libhttpd/fail.c:hfail /sys/src/libhttpd/parse.c:hreqcleanup /sys/src/libhttpd/unallowed.c:hunallowed