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
fd8fdc21
Commit
fd8fdc21
authored
Feb 05, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we have no floating point round-off issues with vcl version.
parent
04b93a77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
vcc_compile.h
lib/libvcc/vcc_compile.h
+2
-2
vcc_parse.c
lib/libvcc/vcc_parse.c
+5
-5
No files found.
lib/libvcc/vcc_compile.h
View file @
fd8fdc21
...
@@ -66,7 +66,7 @@ struct symbol;
...
@@ -66,7 +66,7 @@ struct symbol;
struct
source
{
struct
source
{
VTAILQ_ENTRY
(
source
)
list
;
VTAILQ_ENTRY
(
source
)
list
;
floa
t
syntax
;
in
t
syntax
;
char
*
name
;
char
*
name
;
const
char
*
b
;
const
char
*
b
;
const
char
*
e
;
const
char
*
e
;
...
@@ -183,7 +183,7 @@ VTAILQ_HEAD(inifinhead, inifin);
...
@@ -183,7 +183,7 @@ VTAILQ_HEAD(inifinhead, inifin);
struct
vcc
{
struct
vcc
{
unsigned
magic
;
unsigned
magic
;
#define VCC_MAGIC 0x24ad719d
#define VCC_MAGIC 0x24ad719d
floa
t
syntax
;
in
t
syntax
;
char
*
builtin_vcl
;
char
*
builtin_vcl
;
struct
vfil_path
*
vcl_path
;
struct
vfil_path
*
vcl_path
;
...
...
lib/libvcc/vcc_parse.c
View file @
fd8fdc21
...
@@ -282,14 +282,14 @@ vcc_ParseVcl(struct vcc *tl)
...
@@ -282,14 +282,14 @@ vcc_ParseVcl(struct vcc *tl)
tok1
=
tl
->
t
;
tok1
=
tl
->
t
;
Expect
(
tl
,
CNUM
);
Expect
(
tl
,
CNUM
);
tok1
->
src
->
syntax
=
*
tl
->
t
->
b
-
'0'
;
tok1
->
src
->
syntax
=
(
*
tl
->
t
->
b
-
'0'
)
*
10
;
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
Expect
(
tl
,
'.'
);
Expect
(
tl
,
'.'
);
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
Expect
(
tl
,
CNUM
);
Expect
(
tl
,
CNUM
);
tok2
=
tl
->
t
;
tok2
=
tl
->
t
;
tok1
->
src
->
syntax
+=
.
1
*
(
*
tl
->
t
->
b
-
'0'
);
tok1
->
src
->
syntax
+=
(
*
tl
->
t
->
b
-
'0'
);
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
if
(
tok1
->
e
-
tok1
->
b
!=
1
||
tok2
->
e
-
tok2
->
b
!=
1
)
{
if
(
tok1
->
e
-
tok1
->
b
!=
1
||
tok2
->
e
-
tok2
->
b
!=
1
)
{
...
@@ -314,7 +314,7 @@ vcc_ParseVcl(struct vcc *tl)
...
@@ -314,7 +314,7 @@ vcc_ParseVcl(struct vcc *tl)
VSB_printf
(
tl
->
sb
,
VSB_printf
(
tl
->
sb
,
"VCL version %.1f higher than"
"VCL version %.1f higher than"
" the top level version %.1f
\n
"
,
" the top level version %.1f
\n
"
,
tok1
->
src
->
syntax
,
tl
->
syntax
);
.
1
*
tok1
->
src
->
syntax
,
.
1
*
tl
->
syntax
);
vcc_ErrWhere2
(
tl
,
tok0
,
tl
->
t
);
vcc_ErrWhere2
(
tl
,
tok0
,
tl
->
t
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
}
}
...
@@ -357,7 +357,7 @@ vcc_Parse(struct vcc *tl)
...
@@ -357,7 +357,7 @@ vcc_Parse(struct vcc *tl)
VSB_printf
(
tl
->
sb
,
VSB_printf
(
tl
->
sb
,
"VCL version declaration missing
\n
"
"VCL version declaration missing
\n
"
"Update your VCL to Version 4 syntax, and add
\n
"
"Update your VCL to Version 4 syntax, and add
\n
"
"
\t
vcl 4.
0
;
\n
"
"
\t
vcl 4.
1
;
\n
"
"on the first line of the VCL files.
\n
"
"on the first line of the VCL files.
\n
"
);
);
vcc_ErrWhere
(
tl
,
tl
->
t
);
vcc_ErrWhere
(
tl
,
tl
->
t
);
...
@@ -367,7 +367,7 @@ vcc_Parse(struct vcc *tl)
...
@@ -367,7 +367,7 @@ vcc_Parse(struct vcc *tl)
vcc_ParseVcl
(
tl
);
vcc_ParseVcl
(
tl
);
if
(
tok
->
src
->
syntax
!=
4
.
0
)
{
if
(
tok
->
src
->
syntax
!=
4
.
0
)
{
VSB_printf
(
tl
->
sb
,
"VCL version %.1f not supported.
\n
"
,
VSB_printf
(
tl
->
sb
,
"VCL version %.1f not supported.
\n
"
,
tok
->
src
->
syntax
);
.
1
*
tok
->
src
->
syntax
);
vcc_ErrWhere2
(
tl
,
tok
,
tl
->
t
);
vcc_ErrWhere2
(
tl
,
tok
,
tl
->
t
);
ERRCHK
(
tl
);
ERRCHK
(
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