From ed5b81f608f4140efaf457b22ca2776a30286bef Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 9 May 2007 08:44:28 +0000 Subject: [PATCH] Add back a check that was lost: You must have at least one backend. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1391 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/lib/libvcl/vcc_compile.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/varnish-cache/lib/libvcl/vcc_compile.c b/varnish-cache/lib/libvcl/vcc_compile.c index b01b2498..f012e098 100644 --- a/varnish-cache/lib/libvcl/vcc_compile.c +++ b/varnish-cache/lib/libvcl/vcc_compile.c @@ -627,6 +627,14 @@ vcc_CompileSource(struct vsb *sb, struct source *sp) if (tl->err) return (vcc_DestroyTokenList(tl, NULL)); + /* Check if we have any backends at all */ + if (tl->nbackend == 0) { + vsb_printf(tl->sb, + "No backends in VCL program, at least one is necessary.\n"); + tl->err = 1; + return (vcc_DestroyTokenList(tl, NULL)); + } + /* Check for orphans */ if (vcc_CheckReferences(tl)) return (vcc_DestroyTokenList(tl, NULL)); -- 2.39.5