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
a7ceb252
Commit
a7ceb252
authored
Feb 08, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support IP + STRING
Fixes #2205.
parent
23705c43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
v00020.vtc
bin/varnishtest/tests/v00020.vtc
+11
-3
vcc_expr.c
lib/libvcc/vcc_expr.c
+7
-4
No files found.
bin/varnishtest/tests/v00020.vtc
View file @
a7ceb252
...
...
@@ -108,6 +108,10 @@ varnish v1 -vcl {
set req.http.foo = req.http.foo + "bar" ~ "bar";
set req.http.foo = req.http.foo + "bar" !~ "bar";
set req.http.foo = "foo" + req.ttl;
set req.http.foo = client.ip + ", " + server.ip;
set req.ttl = 1s;
set req.ttl *= 1.5;
set req.ttl = 1.5 s * 2.5;
...
...
@@ -141,9 +145,6 @@ varnish v1 -vcl {
else if (4) { }
else { }
}
sub vcl_backend_response {
set beresp.http.buzz = "ttl=" + beresp.ttl;
}
}
# XXX: not the most clear error message
...
...
@@ -238,6 +239,13 @@ varnish v1 -errvcl {DURATION + STRING not possible.} {
}
}
varnish v1 -errvcl {IP + IP not possible.} {
backend b { .host = "127.0.0.1"; }
sub vcl_recv {
set req.ttl = client.ip + server.ip;
}
}
varnish v1 -errvcl {Name of function, 'foo-bar', contains illegal character '-'} {
backend b { .host = "127.0.0.1"; }
sub foo-bar {
...
...
lib/libvcc/vcc_expr.c
View file @
a7ceb252
...
...
@@ -1019,14 +1019,15 @@ static const struct adds {
{
'-'
,
INT
,
REAL
,
REAL
},
/* Error */
{
'+'
,
TIME
,
INT
,
VOID
},
{
'+'
,
TIME
,
REAL
,
VOID
},
{
'+'
,
INT
,
DURATION
,
VOID
},
{
'+'
,
REAL
,
DURATION
,
VOID
},
{
'+'
,
DURATION
,
INT
,
VOID
},
{
'+'
,
DURATION
,
REAL
,
VOID
},
{
'+'
,
DURATION
,
TIME
,
VOID
},
{
'+'
,
DURATION
,
STRING
,
VOID
},
{
'+'
,
INT
,
DURATION
,
VOID
},
{
'+'
,
IP
,
IP
,
VOID
},
{
'+'
,
REAL
,
DURATION
,
VOID
},
{
'+'
,
TIME
,
INT
,
VOID
},
{
'+'
,
TIME
,
REAL
,
VOID
},
{
EOI
,
VOID
,
VOID
,
VOID
}
};
...
...
@@ -1050,6 +1051,8 @@ vcc_expr_add(struct vcc *tl, struct expr **e, vcc_type_t fmt)
vcc_NextToken
(
tl
);
if
(
f2
==
TIME
)
vcc_expr_mul
(
tl
,
&
e2
,
DURATION
);
else
if
(
f2
==
IP
)
vcc_expr_mul
(
tl
,
&
e2
,
STRING
);
else
vcc_expr_mul
(
tl
,
&
e2
,
f2
);
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