From: phk Date: Thu, 6 Apr 2006 10:01:09 +0000 (+0000) Subject: Close or recycle backend connections as appropriate X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56111ef1f20e1b87b04fc8d01070d49a2779c690;p=varnish Close or recycle backend connections as appropriate git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@136 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- 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,