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
0913f097
Commit
0913f097
authored
Jun 17, 2014
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add y (years) time unit support to VCL
Follows the change in the std vmod a while ago.
parent
e54c8aae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
v00016.vtc
bin/varnishtest/tests/v00016.vtc
+1
-1
vcl.rst
doc/sphinx/reference/vcl.rst
+2
-0
vcc_expr.c
lib/libvcc/vcc_expr.c
+3
-1
No files found.
bin/varnishtest/tests/v00016.vtc
View file @
0913f097
...
...
@@ -73,7 +73,7 @@ varnish v1 -vcl {
}
varnish v1 -errvcl {Unknown time unit 'k'. Legal are 'ms', 's', 'm', 'h', 'd'
and 'w
'} {
varnish v1 -errvcl {Unknown time unit 'k'. Legal are 'ms', 's', 'm', 'h', 'd'
, 'w' and 'y
'} {
backend b { .host = "127.0.0.1"; }
sub vcl_backend_response { set beresp.ttl = 1. k; }
}
...
...
doc/sphinx/reference/vcl.rst
View file @
0913f097
...
...
@@ -115,6 +115,8 @@ so 1.5w is allowed.
w
weeks
y
years
Integers
--------
...
...
lib/libvcc/vcc_expr.c
View file @
0913f097
...
...
@@ -74,10 +74,12 @@ vcc_TimeUnit(struct vcc *tl)
sc
=
60
.
0
*
60
.
0
*
24
.
0
;
else
if
(
vcc_IdIs
(
tl
->
t
,
"w"
))
sc
=
60
.
0
*
60
.
0
*
24
.
0
*
7
.
0
;
else
if
(
vcc_IdIs
(
tl
->
t
,
"y"
))
sc
=
60
.
0
*
60
.
0
*
24
.
0
*
365
.
0
;
else
{
VSB_printf
(
tl
->
sb
,
"Unknown time unit "
);
vcc_ErrToken
(
tl
,
tl
->
t
);
VSB_printf
(
tl
->
sb
,
". Legal are 'ms', 's', 'm', 'h', 'd'
and 'w
'
\n
"
);
VSB_printf
(
tl
->
sb
,
". Legal are 'ms', 's', 'm', 'h', 'd'
, 'w' and 'y
'
\n
"
);
vcc_ErrWhere
(
tl
,
tl
->
t
);
return
(
1
.
0
);
}
...
...
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