Commit 6fa90ee4 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Take another stab at fixing #861 by clearing the correct bit

position of the "last" bit in the included ESI object.
parent 6cc60355
......@@ -497,7 +497,7 @@ ESI_DeliverChild(const struct sess *sp)
*/
cc = ved_deliver_byterange(sp, start/8, last/8);
//printf("CC_LAST %x\n", cc);
cc &= ~(1U << (start & 7));
cc &= ~(1U << (last & 7));
ved_sendchunk(sp, NULL, 0, &cc, 1);
cc = ved_deliver_byterange(sp, 1 + last/8, stop/8);
//printf("CC_STOP %x (%d)\n", cc, (int)(stop & 7));
......
......@@ -12,18 +12,38 @@ server s1 {
rxreq
expect req.url == "/bar"
txresp -body <BAR>
rxreq
expect req.url == "/barf"
txresp -body {[{"program":true,"id":972389,"vendorId":"15451701","starttime":1297777500000,"endtime":1297783500000,"title":"Swimming Pool","oTitle":"true","genre":"0x10x0","timeshiftEnabled":true},{"program":true,"id":972391,"vendorId":"15451702","starttime":1297783500000,"endtime":1297785000000,"title":"Fashion -Trends","oTitle":null,"genre":"0x30x0","timeshiftEnabled":true},{"program":true,"id":972384,"vendorId":"15451703","starttime":1297785000000,"endtime":1297786500000,"title":"Fashion - mænd","oTitle":null,"genre":"0x30x0","timeshiftEnabled":true},{"program":true,"id":972388,"vendorId":"15451704","starttime":1297786500000,"endtime":1297789800000,"title":"The Day Before","oTitle":"true","genre":"0x30x0","timeshiftEnabled":true},{"program":true,"id":972393,"vendorId":"15451705","starttime":1297789800000,"endtime":1297793100000,"title":"Kessels øje","oTitle":null,"genre":"0x20x3","timeshiftEnabled":true}]}
rxreq
expect req.url == "/2"
txresp -body { <esi:include src="/barf" />}
} -start
varnish v1 \
-vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
set beresp.do_gzip = true;
if (req.url == "/1" || req.url == "/2") {
set beresp.do_esi = true;
set beresp.do_gzip = true;
}
}
} -start
client c1 {
txreq -url "/1"
rxresp
} -run
txreq -url "/barf" -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.Content-Encoding == resp.http.Content-Encoding
expect resp.bodylen == 909
txreq -url "/2" -hdr "Accept-Encoding: gzip"
rxresp
gunzip
expect resp.bodylen == 910
} -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