]> err.no Git - varnish/commitdiff
Add back a check that was lost: You must have at least one backend.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 9 May 2007 08:44:28 +0000 (08:44 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 9 May 2007 08:44:28 +0000 (08:44 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1391 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_compile.c

index b01b249800e5a2eaf39c7eb350be92643e49d679..f012e098c278031e034f68729173f442eac972e7 100644 (file)
@@ -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));