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
a80f4ef9
Commit
a80f4ef9
authored
Jun 03, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify bespoke error messages to "Symbol not found" before things
get too confusing.
parent
c3610d36
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
25 deletions
+37
-25
r01837.vtc
bin/varnishtest/tests/r01837.vtc
+1
-1
v00018.vtc
bin/varnishtest/tests/v00018.vtc
+1
-1
v00019.vtc
bin/varnishtest/tests/v00019.vtc
+1
-1
v00021.vtc
bin/varnishtest/tests/v00021.vtc
+1
-1
vcc_action.c
lib/libvcc/vcc_action.c
+3
-3
vcc_backend.c
lib/libvcc/vcc_backend.c
+2
-1
vcc_compile.h
lib/libvcc/vcc_compile.h
+13
-7
vcc_expr.c
lib/libvcc/vcc_expr.c
+1
-2
vcc_symb.c
lib/libvcc/vcc_symb.c
+13
-7
vcc_vmod.c
lib/libvcc/vcc_vmod.c
+1
-1
No files found.
bin/varnishtest/tests/r01837.vtc
View file @
a80f4ef9
varnishtest "Test VCC errors out if probe is used before it is defined"
varnish v1 -errvcl "
Probe
not found: 'p'" {
varnish v1 -errvcl "
Symbol
not found: 'p'" {
backend b {
.host = "127.0.0.1";
.probe = p;
...
...
bin/varnishtest/tests/v00018.vtc
View file @
a80f4ef9
...
...
@@ -133,7 +133,7 @@ varnish v1 -errvcl {Symbol 'vcl_recv' has wrong type (sub):} {
}
}
varnish v1 -syntax 4.0 -errvcl {
Not a VCL label
:} {
varnish v1 -syntax 4.0 -errvcl {
Symbol not found
:} {
sub vcl_recv {
return (vcl(vcl_recv));
}
...
...
bin/varnishtest/tests/v00019.vtc
View file @
a80f4ef9
...
...
@@ -64,7 +64,7 @@ varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
}
}
varnish v1 -errvcl {
Unknown variable
: 'req.http.req.http.foo'} {
varnish v1 -errvcl {
Symbol not found
: 'req.http.req.http.foo'} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
set req.http.req.http.foo = "bar";
...
...
bin/varnishtest/tests/v00021.vtc
View file @
a80f4ef9
...
...
@@ -91,7 +91,7 @@ varnish v1 -vcl {
}
}
varnish v1 -errvcl {
Unknown variable
: 'req.foobar'} {
varnish v1 -errvcl {
Symbol not found
: 'req.foobar'} {
backend foo { .host = "127.0.0.1"; }
sub vcl_recv { set req.foobar = 3; }
}
...
...
lib/libvcc/vcc_action.c
View file @
a80f4ef9
...
...
@@ -94,7 +94,7 @@ vcc_act_set(struct vcc *tl, struct token *t, struct symbol *sym)
(
void
)
t
;
ExpectErr
(
tl
,
ID
);
t
=
tl
->
t
;
sym
=
VCC_SymbolGet
(
tl
,
SYM_VAR
,
"Unknown variable"
,
XREF_NONE
);
sym
=
VCC_SymbolGet
(
tl
,
SYM_VAR
,
SYMTAB_EXISTING
,
XREF_NONE
);
ERRCHK
(
tl
);
AN
(
sym
);
if
(
sym
->
w_methods
==
0
)
{
...
...
@@ -146,7 +146,7 @@ vcc_act_unset(struct vcc *tl, struct token *t, struct symbol *sym)
/* XXX: Wrong, should use VCC_Expr(HEADER) */
ExpectErr
(
tl
,
ID
);
t
=
tl
->
t
;
sym
=
VCC_SymbolGet
(
tl
,
SYM_VAR
,
"Unknown variable"
,
XREF_NONE
);
sym
=
VCC_SymbolGet
(
tl
,
SYM_VAR
,
SYMTAB_EXISTING
,
XREF_NONE
);
ERRCHK
(
tl
);
AN
(
sym
);
if
(
sym
->
u_methods
==
0
)
{
...
...
@@ -269,7 +269,7 @@ vcc_act_return_vcl(struct vcc *tl)
ExpectErr
(
tl
,
'('
);
vcc_NextToken
(
tl
);
ExpectErr
(
tl
,
ID
);
sym
=
VCC_SymbolGet
(
tl
,
SYM_VCL
,
"Not a VCL label"
,
XREF_NONE
);
sym
=
VCC_SymbolGet
(
tl
,
SYM_VCL
,
SYMTAB_EXISTING
,
XREF_NONE
);
ERRCHK
(
tl
);
AN
(
sym
);
if
(
sym
->
eval_priv
==
NULL
)
{
...
...
lib/libvcc/vcc_backend.c
View file @
a80f4ef9
...
...
@@ -432,7 +432,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
(
void
)
vcc_default_probe
(
tl
);
}
else
{
pb
=
VCC_SymbolGet
(
tl
,
SYM_PROBE
,
"Probe not found"
,
XREF_REF
);
SYMTAB_EXISTING
,
XREF_REF
);
ERRCHK
(
tl
);
AN
(
pb
);
Fb
(
tl
,
0
,
"
\t
.probe = %s,
\n
"
,
pb
->
rname
);
...
...
@@ -540,6 +540,7 @@ vcc_ParseBackend(struct vcc *tl)
}
else
{
sym
=
VCC_HandleSymbol
(
tl
,
BACKEND
,
"vgc_backend"
);
ERRCHK
(
tl
);
AN
(
sym
);
dn
=
sym
->
rname
;
if
(
tl
->
default_director
==
NULL
)
{
tl
->
first_director
=
sym
;
...
...
lib/libvcc/vcc_compile.h
View file @
a80f4ef9
...
...
@@ -350,13 +350,19 @@ void vcc_stevedore(struct vcc *vcc, const char *stv_name);
/* vcc_symb.c */
void
VCC_PrintCName
(
struct
vsb
*
vsb
,
const
char
*
b
,
const
char
*
e
);
struct
symbol
*
VCC_MkSym
(
struct
vcc
*
tl
,
const
char
*
b
,
vcc_kind_t
,
int
,
int
);
extern
const
char
XREF_NONE
[];
extern
const
char
XREF_DEF
[];
extern
const
char
XREF_REF
[];
extern
const
char
SYMTAB_NOERR
[];
extern
const
char
SYMTAB_CREATE
[];
struct
symbol
*
VCC_SymbolGet
(
struct
vcc
*
,
vcc_kind_t
,
const
char
*
,
const
char
*
);
struct
symxref
{
const
char
*
name
;
};
extern
const
struct
symxref
XREF_NONE
[
1
];
extern
const
struct
symxref
XREF_DEF
[
1
];
extern
const
struct
symxref
XREF_REF
[
1
];
struct
symmode
{
const
char
*
name
;
};
extern
const
struct
symmode
SYMTAB_NOERR
[
1
];
extern
const
struct
symmode
SYMTAB_CREATE
[
1
];
extern
const
struct
symmode
SYMTAB_EXISTING
[
1
];
struct
symbol
*
VCC_SymbolGet
(
struct
vcc
*
,
vcc_kind_t
,
const
struct
symmode
*
,
const
struct
symxref
*
);
typedef
void
symwalk_f
(
struct
vcc
*
tl
,
const
struct
symbol
*
s
);
void
VCC_WalkSymbols
(
struct
vcc
*
tl
,
symwalk_f
*
func
,
vcc_kind_t
);
...
...
lib/libvcc/vcc_expr.c
View file @
a80f4ef9
...
...
@@ -688,8 +688,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
switch
(
tl
->
t
->
tok
)
{
case
ID
:
t
=
tl
->
t
;
sym
=
VCC_SymbolGet
(
tl
,
SYM_NONE
,
"Symbol not found"
,
XREF_REF
);
sym
=
VCC_SymbolGet
(
tl
,
SYM_NONE
,
SYMTAB_EXISTING
,
XREF_REF
);
ERRCHK
(
tl
);
AN
(
sym
);
if
(
sym
->
kind
==
SYM_FUNC
&&
sym
->
type
==
VOID
)
{
...
...
lib/libvcc/vcc_symb.c
View file @
a80f4ef9
...
...
@@ -226,19 +226,25 @@ vcc_sym_in_tab(struct vcc *tl, struct symtab *st,
}
const
char
XREF_NONE
[]
=
"xref_none"
;
const
char
XREF_DEF
[]
=
"xref_def"
;
const
char
XREF_REF
[]
=
"xref_ref"
;
const
char
SYMTAB_NOERR
[]
=
"sym_noerror"
;
const
char
SYMTAB_CREATE
[]
=
"sym_create"
;
const
struct
symxref
XREF_NONE
[
1
]
=
{{
"xref_none"
}};
const
struct
symxref
XREF_DEF
[
1
]
=
{{
"xref_def"
}};
const
struct
symxref
XREF_REF
[
1
]
=
{{
"xref_ref"
}};
const
struct
symmode
SYMTAB_NOERR
[
1
]
=
{{
"sym_noerror"
}};
const
struct
symmode
SYMTAB_CREATE
[
1
]
=
{{
"sym_create"
}};
const
struct
symmode
SYMTAB_EXISTING
[
1
]
=
{{
"Symbol not found"
}};
struct
symbol
*
VCC_SymbolGet
(
struct
vcc
*
tl
,
vcc_kind_t
kind
,
const
char
*
e
,
const
char
*
x
)
VCC_SymbolGet
(
struct
vcc
*
tl
,
vcc_kind_t
kind
,
const
struct
symmode
*
e
,
const
struct
symxref
*
x
)
{
struct
symtab
*
st
;
struct
symbol
*
sym
;
struct
token
*
t0
,
*
tn
,
*
tn1
;
AN
(
tl
);
AN
(
e
);
AN
(
x
);
AN
(
x
->
name
);
if
(
tl
->
syntax
>=
VCL_41
&&
e
==
SYMTAB_CREATE
&&
kind
!=
SYM_SUB
&&
(
tl
->
t
->
b
[
0
]
==
'v'
||
tl
->
t
->
b
[
0
]
==
'V'
)
&&
(
tl
->
t
->
b
[
1
]
==
'c'
||
tl
->
t
->
b
[
1
]
==
'C'
)
&&
...
...
@@ -270,7 +276,7 @@ VCC_SymbolGet(struct vcc *tl, vcc_kind_t kind, const char *e, const char *x)
return
(
sym
);
tl
->
t
=
VTAILQ_NEXT
(
tn
,
list
);
if
(
sym
==
NULL
)
{
VSB_printf
(
tl
->
sb
,
"%s: '"
,
e
);
VSB_printf
(
tl
->
sb
,
"%s: '"
,
e
->
name
);
for
(
tn1
=
t0
;
tn1
!=
tl
->
t
;
tn1
=
VTAILQ_NEXT
(
tn1
,
list
))
VSB_printf
(
tl
->
sb
,
"%.*s"
,
PF
(
tn1
));
VSB_printf
(
tl
->
sb
,
"'"
);
...
...
lib/libvcc/vcc_vmod.c
View file @
a80f4ef9
...
...
@@ -402,7 +402,7 @@ vcc_Act_New(struct vcc *tl, struct token *t, struct symbol *sym)
ExpectErr
(
tl
,
ID
);
t
=
tl
->
t
;
sy2
=
VCC_SymbolGet
(
tl
,
SYM_OBJECT
,
"Symbol not found"
,
XREF_NONE
);
sy2
=
VCC_SymbolGet
(
tl
,
SYM_OBJECT
,
SYMTAB_EXISTING
,
XREF_NONE
);
ERRCHK
(
tl
);
AN
(
sy2
);
if
(
sy2
->
eval_priv
==
NULL
)
{
...
...
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