]> err.no Git - varnish/commitdiff
Close or recycle backend connections as appropriate
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 6 Apr 2006 10:01:09 +0000 (10:01 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 6 Apr 2006 10:01:09 +0000 (10:01 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@136 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pass.c

index 64a7c58df000f5307070f8353de6145c9171cfa6..0c57b0d9699b7037bb3524337ad4fa5f774df4cf 100644 (file)
@@ -104,6 +104,14 @@ PassSession(struct worker *w, struct sess *sp)
                assert(cl == 0);
        }
 
+       if (sp2.http.H_Connection != NULL &&
+           !strcmp(sp2.http.H_Connection, "close")) {
+               close(fd);
+               VBE_ClosedFd(fd_token);
+       } else {
+               VBE_RecycleFd(fd_token);
+       }
+
        /* XXX: this really belongs in the acceptor */
        if (sp->rcv_len > sp->rcv_ptr)
                memmove(sp->rcv, sp->rcv + sp->rcv_ptr,