r909 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Aug 23 16:30:06 CEST 2006


Author: phk
Date: 2006-08-23 16:30:06 +0200 (Wed, 23 Aug 2006)
New Revision: 909

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pass.c
Log:
Handle backend failure in pass mode


Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-08-23 13:11:14 UTC (rev 908)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-08-23 14:30:06 UTC (rev 909)
@@ -45,6 +45,10 @@
 		i = http_Read(hp, fd, buf, c);
 		if (i == 0 && bi == NULL)
 			return (1);
+		if (i <= 0) {
+			vca_close_session(sp, "backend closed");
+			return (1);
+		}
 		assert(i > 0);
 		sp->wrk->acct.bodybytes += WRK_Write(sp->wrk, buf, i);
 		if (WRK_Flush(sp->wrk))




More information about the varnish-commit mailing list