r4157 - branches/sky/log_error/varnish-cache/bin/varnishd

sky at projects.linpro.no sky at projects.linpro.no
Wed Jul 29 10:56:44 CEST 2009


Author: sky
Date: 2009-07-29 10:56:44 +0200 (Wed, 29 Jul 2009)
New Revision: 4157

Modified:
   branches/sky/log_error/varnish-cache/bin/varnishd/cache_fetch.c
Log:
when backend fetches fail, tell the debug log why

Modified: branches/sky/log_error/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- branches/sky/log_error/varnish-cache/bin/varnishd/cache_fetch.c	2009-07-28 20:08:29 UTC (rev 4156)
+++ branches/sky/log_error/varnish-cache/bin/varnishd/cache_fetch.c	2009-07-29 08:56:44 UTC (rev 4157)
@@ -431,9 +431,15 @@
 		/* nothing */
 	} else if (http_GetHdr(hp, H_Content_Length, &b)) {
 		cls = fetch_straight(sp, sp->wrk->htc, b);
+		if (cls < 0)
+			WSL(sp->wrk, SLT_Debug, vc->fd, "Couldn't fetch straight reply (%s:%d)",
+			    __FILE__, __LINE__);
 		mklen = 1;
 	} else if (http_HdrIs(hp, H_Transfer_Encoding, "chunked")) {
 		cls = fetch_chunked(sp, sp->wrk->htc);
+		if (cls < 0)
+			WSL(sp->wrk, SLT_Debug, vc->fd, "Couldn't fetch chunked reply (%s:%d)",
+			    __FILE__, __LINE__);
 		mklen = 1;
 	} else if (http_GetHdr(hp, H_Transfer_Encoding, &b)) {
 		/* XXX: AUGH! */
@@ -453,12 +459,18 @@
 		 * comes in any case.
 		 */
 		cls = fetch_eof(sp, sp->wrk->htc);
+		if (cls < 0)
+			WSL(sp->wrk, SLT_Debug, vc->fd, "Couldn't fetch eof reply (%s:%d)",
+			    __FILE__, __LINE__);
 		mklen = 1;
 	} else if (hp->protover < 1.1) {
 		/*
 		 * With no Connection header, assume EOF
 		 */
 		cls = fetch_eof(sp, sp->wrk->htc);
+		if (cls < 0)
+			WSL(sp->wrk, SLT_Debug, vc->fd, "Couldn't fetch eof reply (%s:%d)",
+			    __FILE__, __LINE__);
 		mklen = 1;
 	} else {
 		/*



More information about the varnish-commit mailing list