r4318 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Thu Oct 8 18:01:45 CEST 2009


Author: tfheen
Date: 2009-10-08 18:01:45 +0200 (Thu, 08 Oct 2009)
New Revision: 4318

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_center.c
Log:
Merge r4240: Handle return(error) gracefully

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: branches/2.0/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2009-10-08 15:55:18 UTC (rev 4317)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2009-10-08 16:01:45 UTC (rev 4318)
@@ -335,6 +335,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