From: phk Date: Wed, 9 May 2007 08:44:28 +0000 (+0000) Subject: Add back a check that was lost: You must have at least one backend. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed5b81f608f4140efaf457b22ca2776a30286bef;p=varnish 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 --- 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));