Commit 77a10978 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix an off-by-one bug, when requested range exceeds available data.

Submitted by: 	Luc Saillard


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4865 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 10a88d43
......@@ -169,7 +169,7 @@ res_dorange(struct sess *sp, const char *r, unsigned *plow, unsigned *phigh)
return;
if (high >= sp->obj->len)
high = sp->obj->len;
high = sp->obj->len - 1;
if (low > high)
return;
......
# $Id$
test "Range bug"
server s1 {
rxreq
txresp -bodylen 100
} -start
varnish v1 -vcl+backend {
} -start
varnish v1 -cliok "param.set http_range_support on"
client c1 {
txreq -hdr "Range: bytes=50-200"
rxresp
expect resp.status == 206
expect resp.bodylen == 50
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment