r4240 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Sep 24 16:21:37 CEST 2009


Author: phk
Date: 2009-09-24 16:21:37 +0200 (Thu, 24 Sep 2009)
New Revision: 4240

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
If we come into vcl_error{} with a non-3-digit error status, for instance
because vcl_recv does "return(error);", force the status to 501.

Fixes: #558


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2009-09-22 14:36:05 UTC (rev 4239)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2009-09-24 14:21:37 UTC (rev 4240)
@@ -344,6 +344,9 @@
 	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
 	h = sp->obj->http;
 
+	if (sp->err_code < 100 || sp->err_code > 999)
+		sp->err_code = 501;
+
 	http_PutProtocol(w, sp->fd, h, "HTTP/1.1");
 	http_PutStatus(w, sp->fd, h, sp->err_code);
 	TIM_format(TIM_real(), date);



More information about the varnish-commit mailing list