Commit b4d362ec authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Restrict the "esi" action to vcl_fetch{} now that we have the

VCC infrastructure to do so.

Fixes:	#638



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4743 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 09e8fbd0
......@@ -482,6 +482,7 @@ typedef void action_f(struct tokenlist *tl);
static struct action_table {
const char *name;
action_f *func;
unsigned bitmask;
} action_table[] = {
{ "error", parse_error },
......@@ -492,7 +493,7 @@ static struct action_table {
/* 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 @@ vcc_ParseAction(struct tokenlist *tl)
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);
}
......
......@@ -358,8 +358,8 @@ vcc_CheckUseRecurse(struct tokenlist *tl, const struct proc *p,
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 @@ vcc_CheckUses(struct tokenlist *tl)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment