[master] 6fa90ee Take another stab at fixing #861 by clearing the correct bit position of the "last" bit in the included ESI object.
Poul-Henning Kamp
phk at varnish-cache.org
Wed Feb 16 07:28:01 CET 2011
commit 6fa90ee463d32187361bd19082242bd36957b8fd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Feb 15 21:56:01 2011 +0000
Take another stab at fixing #861 by clearing the correct bit
position of the "last" bit in the included ESI object.
diff --git a/bin/varnishd/cache_esi_deliver.c b/bin/varnishd/cache_esi_deliver.c
index 9734063..29543a8 100644
--- a/bin/varnishd/cache_esi_deliver.c
+++ b/bin/varnishd/cache_esi_deliver.c
@@ -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));
diff --git a/bin/varnishtest/tests/r00861.vtc b/bin/varnishtest/tests/r00861.vtc
index b9329a9..38db46b 100644
--- a/bin/varnishtest/tests/r00861.vtc
+++ b/bin/varnishtest/tests/r00861.vtc
@@ -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
More information about the varnish-commit
mailing list