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
cc513fdc
Commit
cc513fdc
authored
Oct 11, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a VCL expression type error: TIME +/- DURATION should return TIME
Fixes #1211 Thanks to: Federico G. Schwindt
parent
968d11d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
r01211.vtc
bin/varnishtest/tests/r01211.vtc
+22
-0
vcc_expr.c
lib/libvcl/vcc_expr.c
+3
-0
No files found.
bin/varnishtest/tests/r01211.vtc
0 → 100644
View file @
cc513fdc
varnishtest "TIME +/- DURATION -> TIME"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_deliver {
set resp.http.bar = now + 4 d;
set resp.http.foo = now - 4 d;
}
} -start
client c1 {
txreq
rxresp
expect resp.http.bar ~ "..., .. ... 20[1-9][0-9] ..:..:.. GMT"
expect resp.http.foo ~ "..., .. ... 20[1-9][0-9] ..:..:.. GMT"
} -run
lib/libvcl/vcc_expr.c
View file @
cc513fdc
...
...
@@ -847,6 +847,9 @@ vcc_expr_add(struct vcc *tl, struct expr **e, enum var_type fmt)
ERRCHK
(
tl
);
if
(
tk
->
tok
==
'-'
&&
(
*
e
)
->
fmt
==
TIME
&&
e2
->
fmt
==
TIME
)
{
/* OK */
}
else
if
((
*
e
)
->
fmt
==
TIME
&&
e2
->
fmt
==
DURATION
)
{
f2
=
TIME
;
/* OK */
}
else
if
(
tk
->
tok
==
'-'
&&
(
*
e
)
->
fmt
==
BYTES
&&
e2
->
fmt
==
BYTES
)
{
/* OK */
...
...
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