r4626 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Wed Mar 17 10:38:47 CET 2010


Author: phk
Date: 2010-03-17 10:38:47 +0100 (Wed, 17 Mar 2010)
New Revision: 4626

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_action.c
Log:
Add a specific error message to explain <action> -> return(<action>)
syntax change



Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-03-17 09:19:25 UTC (rev 4625)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-03-17 09:38:47 UTC (rev 4626)
@@ -511,6 +511,17 @@
 
 /*--------------------------------------------------------------------*/
 
+static void
+parse_new_syntax(struct tokenlist *tl)
+{
+
+	vsb_printf(tl->sb, "Please change \"%.*s\" to \"return(%.*s)\".\n",
+	    PF(tl->t), PF(tl->t));
+	vcc_ErrWhere(tl, tl->t);
+}
+
+/*--------------------------------------------------------------------*/
+
 typedef void action_f(struct tokenlist *tl);
 
 static struct action_table {
@@ -520,6 +531,11 @@
 	{ "restart",		parse_restart },
 	{ "error",		parse_error },
 
+#define VCL_RET_MAC(l, U)						\
+	{ #l,			parse_new_syntax },
+#include "vcl_returns.h"
+#undef VCL_RET_MAC
+
 	/* Keep list sorted from here */
 	{ "call",		parse_call },
 	{ "esi",		parse_esi },




More information about the varnish-commit mailing list