Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
1ca122e4
Commit
1ca122e4
authored
Feb 02, 2016
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error earlier if we cannot find the probe
We don't have forward declarations in VCL. OK'd by phk@. Fixes #1837.
parent
8c77b5df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
r01837.vtc
bin/varnishtest/tests/r01837.vtc
+10
-0
v00034.vtc
bin/varnishtest/tests/v00034.vtc
+1
-1
vcc_backend.c
lib/libvcc/vcc_backend.c
+6
-0
No files found.
bin/varnishtest/tests/r01837.vtc
0 → 100644
View file @
1ca122e4
varnishtest "Test VCC errors out if probe is used before it is defined"
varnish v1 -errvcl "Probe p not found" {
backend b {
.host = "127.0.0.1";
.probe = p;
}
probe p {
}
}
bin/varnishtest/tests/v00034.vtc
View file @
1ca122e4
...
...
@@ -20,7 +20,7 @@ varnish v1 -errvcl {Backend s1 redefined} {
}
varnish v1 -errvcl {Probe p1 redefined} {
backend s1 { .host = "127.0.0.1"; .probe = p1;}
probe p1 { }
probe p1 { }
backend s1 { .host = "127.0.0.1"; .probe = p1;}
}
lib/libvcc/vcc_backend.c
View file @
1ca122e4
...
...
@@ -384,6 +384,12 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
Fb
(
tl
,
0
,
"
\t
.probe = &%s,
\n
"
,
p
);
ERRCHK
(
tl
);
}
else
if
(
vcc_IdIs
(
t_field
,
"probe"
)
&&
tl
->
t
->
tok
==
ID
)
{
if
(
VCC_FindSymbol
(
tl
,
tl
->
t
,
SYM_PROBE
)
==
NULL
)
{
VSB_printf
(
tl
->
sb
,
"Probe %.*s not found
\n
"
,
PF
(
tl
->
t
));
vcc_ErrWhere
(
tl
,
tl
->
t
);
return
;
}
Fb
(
tl
,
0
,
"
\t
.probe = &vgc_probe_%.*s,
\n
"
,
PF
(
tl
->
t
));
vcc_AddRef
(
tl
,
tl
->
t
,
SYM_PROBE
);
vcc_NextToken
(
tl
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment