r136 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Apr 6 12:01:09 CEST 2006


Author: phk
Date: 2006-04-06 12:01:09 +0200 (Thu, 06 Apr 2006)
New Revision: 136

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pass.c
Log:
Close or recycle backend connections as appropriate


Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-04-06 10:00:45 UTC (rev 135)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-04-06 10:01:09 UTC (rev 136)
@@ -104,6 +104,14 @@
 		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,




More information about the varnish-commit mailing list