Mailing List Archive

r3193 - in trunk/varnish-cache/bin: varnishd varnishtest/tests
Author: phk
Date: 2008-09-16 20:56:10 +0200 (Tue, 16 Sep 2008)
New Revision: 3193

Added:
trunk/varnish-cache/bin/varnishtest/tests/r00318.vtc
Modified:
trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
ESI processing should ignore responses with no body.

Fixes #318



Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2008-09-16 12:25:46 UTC (rev 3192)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2008-09-16 18:56:10 UTC (rev 3193)
@@ -635,6 +635,9 @@
return;
}

+ if (VTAILQ_EMPTY(&sp->obj->store))
+ return;
+
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);

if (!(params->esi_syntax & 0x00000001)) {

Added: trunk/varnish-cache/bin/varnishtest/tests/r00318.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/r00318.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/r00318.vtc 2008-09-16 18:56:10 UTC (rev 3193)
@@ -0,0 +1,22 @@
+# $Id$
+
+test "ESI with no body in response"
+
+server s1 {
+ rxreq
+ txresp -status 302
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_fetch {
+ esi;
+ pass;
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 302
+} -run
+