]> err.no Git - varnish/commitdiff
Make sure we always close the client connection if we pass through
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 19 Sep 2008 20:20:10 +0000 (20:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 19 Sep 2008 20:20:10 +0000 (20:20 +0000)
vcl_error{}

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3204 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishtest/tests/b00017.vtc [new file with mode: 0644]

index 3aab12e54e7352b1e07f785faea187549ec69b09..097a739d8a928779fa4350b991eebd6a667c5c7c 100644 (file)
@@ -305,6 +305,10 @@ cnt_error(struct sess *sp)
        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);
diff --git a/varnish-cache/bin/varnishtest/tests/b00017.vtc b/varnish-cache/bin/varnishtest/tests/b00017.vtc
new file mode 100644 (file)
index 0000000..352428e
--- /dev/null
@@ -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