Commit 5b7b2651 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make it possible to say:

	if (req.backend == b1)

in VCL.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3246 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 92f27bbd
......@@ -322,10 +322,29 @@ Cond_Bool(const struct var *vp, const struct tokenlist *tl)
}
static void
Cond_Backend(const struct var *vp, const struct tokenlist *tl)
Cond_Backend(const struct var *vp, struct tokenlist *tl)
{
Fb(tl, 1, "%s\n", vp->rname);
if (tl->t->tok == T_EQ) {
Fb(tl, 1, " ==\n");
} else if (tl->t->tok == T_NEQ) {
Fb(tl, 1, " !=\n");
} else {
vsb_printf(tl->sb, "Invalid condition ");
vcc_ErrToken(tl, tl->t);
vsb_printf(tl->sb, " on backend variable\n");
vsb_printf(tl->sb,
" only '==' and '!=' are legal\n");
vcc_ErrWhere(tl, tl->t);
return;
}
vcc_NextToken(tl);
vcc_ExpectCid(tl);
ERRCHK(tl);
vcc_AddRef(tl, tl->t, R_BACKEND);
Fb(tl, 1, "VGC_backend_%.*s\n", PF(tl->t));
vcc_NextToken(tl);
}
static void
......
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