On Sun, Jan 05, 2014 at 08:34:35PM +0000, Robert Lemmen wrote:
> hi aiko,
> 
> On Sat, Jan 04, 2014 at 06:02:22PM +0100, Aiko Barz wrote:
> > Example file size: 380476
> > Requested range by zsync: bytes=0-380927
> > 
> > So, the client asked for a part of the file that lies beyond the end
> > of the file. Most web servers ignore this behavior like nginx:
> > 
> > Request:
> > GET /20121009-165404.jpg HTTP/1.1
> > User-Agent: zsync/0.6.2
> > Host: tumbleweed:80
> > Referer: http://tumbleweed:80/20121009-165404.jpg.zsync
> > Range: bytes=0-380927
> > Connection: close
> > 
> > Reply:
> > HTTP/1.1 206 Partial Content
> > Server: nginx/1.2.1
> > Date: Sat, 04 Jan 2014 15:44:01 GMT
> > Content-Type: image/jpeg
> > Content-Length: 380476
> > Last-Modified: Fri, 03 Jan 2014 14:03:32 GMT
> > Connection: close
> > Content-Range: bytes 0-380475/380476
> > 
> > But from my understanding, this might also result in 416 reply:
> > 416 Requested Range Not Satisfiable
> 
> very interesting, but could you give me a little bit more information:
> 
> - to rephrase, you are saying that zsync sends range requests past the
>   end of the file, and that some/most webservers satisfy these by only
>   returning the data until the end of file, but that it would also be
>   spec-compliant to return an error. correct?

Yes, see the reply header above: The "Content-Length" and the
"Content-Range" values are smaller than the requested "Range". The
replied size matches the file size. The replied size is actually also
advertised in the meta description of the "20121009-165404.jpg.zsync"
file.

About the spec-comliance: I am not sure. Maybe, it is even allowed
behavior according to:
"For byte-ranges, this means that the first- byte-pos of all of the
byte-range-spec values were greater than the current length of the
selected resource." It does not say much about the last byte.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

> - is this a theoretical thing or can you observe it on an actual file?
>   could I have that file?

I have seen this behaviour with any file I created. So you can create a
file with zsyncmake yourself and look at the HTTP headers in wireshark.

> - have you ever seen that error 416?

Only with my own webserver implementation. Maybe I should not be too
harsh with out-of-range requests...

Kind regards,
Aiko
-- 
:wq ✉


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to