r3204 - in trunk/varnish-cache/bin: varnishd varnishtest/tests

phk at projects.linpro.no phk at projects.linpro.no
Fri Sep 19 22:20:11 CEST 2008


Author: phk
Date: 2008-09-19 22:20:10 +0200 (Fri, 19 Sep 2008)
New Revision: 3204

Added:
   trunk/varnish-cache/bin/varnishtest/tests/b00017.vtc
Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Make sure we always close the client connection if we pass through
vcl_error{}



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2008-09-19 16:27:44 UTC (rev 3203)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2008-09-19 20:20:10 UTC (rev 3204)
@@ -305,6 +305,10 @@
 	char date[40];
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+
+	/* We always close when we take this path */
+	sp->doclose = "error";
+
 	w = sp->wrk;
 	if (sp->obj == NULL) {
 		HSH_Prealloc(sp);

Added: trunk/varnish-cache/bin/varnishtest/tests/b00017.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00017.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00017.vtc	2008-09-19 20:20:10 UTC (rev 3204)
@@ -0,0 +1,20 @@
+# $Id$
+
+test "Check that we close one error"
+
+varnish v1 -vcl { 
+	backend foo {
+		.host = "127.0.0.2";
+		.port = "9080";
+	}
+	sub vcl_recv {
+		error 888;
+	}
+} -start
+
+client c1 {
+	txreq -url "/"
+	rxresp
+	expect resp.status == 888
+	expect resp.http.connection == close
+} -run




More information about the varnish-commit mailing list