r4543 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Feb 10 11:35:32 CET 2010


Author: phk
Date: 2010-02-10 11:35:32 +0100 (Wed, 10 Feb 2010)
New Revision: 4543

Modified:
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
Log:
Make sure we always close backend socket if the backend sends
"Connection: close" or if a HTTP/1.0 backend does not send "Connection: keep-alive".

Fixes	#495



Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-02-10 10:34:39 UTC (rev 4542)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-02-10 10:35:32 UTC (rev 4543)
@@ -497,6 +497,12 @@
 		mklen = 1;
 	}
 
+	if (http_HdrIs(hp, H_Connection, "close"))
+		cls = 1;
+
+	if (hp->protover < 1.1 && !http_HdrIs(hp, H_Connection, "keep-alive"))
+		cls = 1;
+
 	if (cls < 0) {
 		sp->wrk->stats.fetch_failed++;
 		/* XXX: Wouldn't this store automatically be released ? */



More information about the varnish-commit mailing list