Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
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
Show 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