[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    r4318 - branches/2.0/varnish-cache/bin/varnishd
From:       tfheen () projects ! linpro ! no (tfheen at projects ! linpro ! no)
Date:       2009-10-08 16:01:45
Message-ID: 20091008160145.C684C1F736F () projects ! linpro ! no
[Download RAW message or body]

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);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic