Commit fb532b8f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Improve error messages related to syntax check of backend decls.



git-svn-id: http://www.varnish-cache.org/svn/trunk@2881 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent efcb1249
......@@ -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);
......
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