Commit 12159331 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Disable speculative Range handling on streaming transactions where

we don't yet know the length.

I attempted to add a way to determine if the object was big enough
*yet* to satisfy the Range, but that was non-viable.

Fixes:	#1777
parent 69123e7e
......@@ -137,7 +137,7 @@ vrg_dorange(struct req *req, const char *r)
high = req->resp_len - 1;
} else if (req->resp_len >= 0 && (high >= req->resp_len || !has_high))
high = req->resp_len - 1;
else if (!has_high)
else if (!has_high || req->resp_len < 0)
return (NULL); // Allow 200 response
/*
* else (bo != NULL) {
......
......@@ -176,7 +176,7 @@ client c1 {
-hdr "Range: bytes=2-5" \
-hdr "Accept-encoding: gzip"
rxresp
expect resp.status == 206
expect resp.http.Content-Range == "bytes 2-5/*"
expect resp.http.Content-Length == 4
expect resp.status == 200
gunzip
expect resp.bodylen == 100
} -run
varnishtest "range asked longer than object"
server s1 {
rxreq
txresp -nolen -hdr "Transfer-Encoding: chunked"
delay .5
chunkedlen 64
chunkedlen 64
chunkedlen 0
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq -hdr "Range: bytes=0-129"
rxresp
expect resp.status == 200
} -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