From 56111ef1f20e1b87b04fc8d01070d49a2779c690 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 6 Apr 2006 10:01:09 +0000 Subject: [PATCH] Close or recycle backend connections as appropriate git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@136 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_pass.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_pass.c b/varnish-cache/bin/varnishd/cache_pass.c index 64a7c58d..0c57b0d9 100644 --- a/varnish-cache/bin/varnishd/cache_pass.c +++ b/varnish-cache/bin/varnishd/cache_pass.c @@ -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, -- 2.39.5