]> err.no Git - varnish/commitdiff
Improve error messages related to syntax check of backend decls.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 7 Jul 2008 17:19:32 +0000 (17:19 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 7 Jul 2008 17:19:32 +0000 (17:19 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2881 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvcl/vcc_backend.c

index f54d988bd8b806b8f79d747621e19ad2ecc06741..3dc32e81bdef4b9bd1e9b8212f2e7dd42cf209d8 100644 (file)
@@ -172,7 +172,7 @@ vcc_IsField(struct tokenlist *tl, struct token **t, struct fld_spec *fs)
        return;
 }
 
-static void
+static int
 vcc_FieldsOk(struct tokenlist *tl, const struct fld_spec *fs)
 {
        int ok = 1;
@@ -180,14 +180,11 @@ vcc_FieldsOk(struct tokenlist *tl, const struct fld_spec *fs)
        for (; fs->name != NULL; fs++) {
                if (*fs->name == '!' && fs->found == NULL) {
                        vsb_printf(tl->sb,
-                           "Mandatory field .'%s' missing.\n", fs->name + 1);
+                           "Mandatory field '%s' missing.\n", fs->name + 1);
                        ok = 0;
                }
        }
-       if (!ok) {
-               vcc_ErrWhere(tl, tl->t);
-       }
-       return;
+       return (ok);
 }
 
 
@@ -291,9 +288,7 @@ vcc_ParseBackendHost(struct tokenlist *tl, int *nbh, const struct token *name, c
                ExpectErr(tl, ';');
                vcc_NextToken(tl);
        }
-       if (!tl->err)
-               vcc_FieldsOk(tl, fs);
-       if (tl->err) {
+       if (tl->err || !vcc_FieldsOk(tl, fs)) {
                vsb_printf(tl->sb,
                    "\nIn backend host specfication starting at:\n");
                vcc_ErrWhere(tl, t_first);