r421 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Jul 11 09:38:42 CEST 2006


Author: phk
Date: 2006-07-11 09:38:42 +0200 (Tue, 11 Jul 2006)
New Revision: 421

Modified:
   trunk/varnish-cache/bin/varnishd/cache_response.c
Log:
Add 500 messages.


Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2006-07-11 07:30:53 UTC (rev 420)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2006-07-11 07:38:42 UTC (rev 421)
@@ -22,6 +22,7 @@
 	if (msg == NULL) {
 		switch (error) {
 		case 400:	msg = "Bad Request"; break;
+		case 500:	msg = "Internal Error"; break;
 		default:	msg = "HTTP request error"; break;
 		}
 	}
@@ -43,8 +44,18 @@
 		"  </HEAD>\r\n"
 		"  <BODY>\r\n");
 	sbuf_printf(w->sb, "    <H1>Error %03d %s</H1>\r\n", error, msg);
+	switch(error) {
+	case 400:
+		sbuf_cat(w->sb,
+		    "    Your HTTP protocol request did not make sense.\r\n");
+		break;
+	case 500:
+	default:
+		sbuf_cat(w->sb,
+		    "    Something unexpected happened.\r\n");
+		break;
+	}
 	sbuf_cat(w->sb,
-		"    Your HTTP protocol request did not make sense.\r\n"
 		"    <P>\r\n"
 		"    <I>\r\n"
 		"    <A href=\"http://varnish.linpro.no/\">Varnish</A>\r\n"




More information about the varnish-commit mailing list