r4743 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Wed Apr 28 13:05:44 CEST 2010


Author: phk
Date: 2010-04-28 13:05:43 +0200 (Wed, 28 Apr 2010)
New Revision: 4743

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_action.c
   trunk/varnish-cache/lib/libvcl/vcc_xref.c
Log:
Restrict the "esi" action to vcl_fetch{} now that we have the
VCC infrastructure to do so.

Fixes:	#638



Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-04-28 11:04:53 UTC (rev 4742)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-04-28 11:05:43 UTC (rev 4743)
@@ -482,6 +482,7 @@
 static struct action_table {
 	const char		*name;
 	action_f		*func;
+	unsigned		bitmask;
 } action_table[] = {
 	{ "error",		parse_error },
 
@@ -492,7 +493,7 @@
 
 	/* Keep list sorted from here */
 	{ "call",		parse_call },
-	{ "esi",		parse_esi },
+	{ "esi",		parse_esi, VCL_MET_FETCH },
 	{ "panic",		parse_panic },
 	{ "purge",		parse_purge },
 	{ "purge_url",		parse_purge_url },
@@ -515,6 +516,8 @@
 	assert (at->tok == ID);
 	for(atp = action_table; atp->name != NULL; atp++) {
 		if (vcc_IdIs(at, atp->name)) {
+			if (atp->bitmask != 0)
+				vcc_AddUses(tl, at, atp->bitmask, "is");
 			atp->func(tl);
 			return(1);
 		}

Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_xref.c	2010-04-28 11:04:53 UTC (rev 4742)
+++ trunk/varnish-cache/lib/libvcl/vcc_xref.c	2010-04-28 11:05:43 UTC (rev 4743)
@@ -358,8 +358,8 @@
 	pu = vcc_FindIllegalUse(p, m);
 	if (pu != NULL) {
 		vsb_printf(tl->sb,
-		    "Variable \"%.*s\" is not available in %s\n",
-		    PF(pu->t), m->name);
+		    "'%.*s': %s not possible in method '%.*s'.\n",
+		    PF(pu->t), pu->use, PF(p->name));
 		vcc_ErrWhere(tl, pu->t);
 		vsb_printf(tl->sb, "\n...in function \"%.*s\"\n",
 		    PF(p->name));
@@ -393,7 +393,7 @@
 		pu = vcc_FindIllegalUse(p, m);
 		if (pu != NULL) {
 			vsb_printf(tl->sb,
-			    "Variable '%.*s': %s not allowed in method '%.*s'.",
+			    "'%.*s': %s not possible in method '%.*s'.",
 			    PF(pu->t), pu->use, PF(p->name));
 			vsb_cat(tl->sb, "\nAt: ");
 			vcc_ErrWhere(tl, pu->t);




More information about the varnish-commit mailing list