r3729 - in branches/2.0/varnish-cache/bin: varnishd varnishtest/tests
tfheen at projects.linpro.no
tfheen at projects.linpro.no
Wed Feb 11 07:58:38 CET 2009
Author: tfheen
Date: 2009-02-11 07:58:38 +0100 (Wed, 11 Feb 2009)
New Revision: 3729
Added:
branches/2.0/varnish-cache/bin/varnishtest/tests/r00427.vtc
Modified:
branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
Merge r3547:
Stop processing ESI elements as soon as we discover that the client
has closed the connection on us.
Fixes #427
Modified: branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c 2009-02-11 06:55:23 UTC (rev 3728)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_vrt_esi.c 2009-02-11 06:58:38 UTC (rev 3729)
@@ -862,6 +862,8 @@
sp->esis--;
sp->obj = obj;
WRW_Reserve(sp->wrk, &sp->fd);
+ if (sp->fd < 0)
+ break;
}
if (sp->esis == 0 && sp->http->protover >= 1.1)
(void)WRW_Write(sp->wrk, "0\r\n\r\n", -1);
Copied: branches/2.0/varnish-cache/bin/varnishtest/tests/r00427.vtc (from rev 3547, trunk/varnish-cache/bin/varnishtest/tests/r00427.vtc)
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/r00427.vtc (rev 0)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/r00427.vtc 2009-02-11 06:58:38 UTC (rev 3729)
@@ -0,0 +1,43 @@
+# $Id$
+
+test "client close in ESI delivery"
+
+server s1 {
+ rxreq
+ txresp -body {
+ <esi:include src="/foo">
+ <esi:include src="/bar">
+ <esi:include src="/barf">
+ }
+
+ rxreq
+ expect req.url == "/foo"
+ sema r1 sync 2
+ sema r1 sync 2
+ txresp -body "[foo]"
+
+ rxreq
+ expect req.url == "/bar"
+ txresp -body "[bar]"
+
+ rxreq
+ expect req.url == "/barf"
+ txresp -body "[barf]"
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_fetch {
+ esi;
+ }
+} -start
+
+client c1 {
+ txreq
+ sema r1 sync 2
+} -run
+
+client c1 {
+ sema r1 sync 2
+ txreq
+ rxresp
+} -run
More information about the varnish-commit
mailing list