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
00bcc3ea
Commit
00bcc3ea
authored
Oct 01, 2015
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert arguments to strings as well
This is consistent with what we do in other cases.
parent
acdaa4bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
d00003.vtc
bin/varnishtest/tests/d00003.vtc
+16
-11
vcc_expr.c
lib/libvcc/vcc_expr.c
+3
-0
No files found.
bin/varnishtest/tests/d00003.vtc
View file @
00bcc3ea
...
@@ -5,6 +5,8 @@ server s1 {
...
@@ -5,6 +5,8 @@ server s1 {
txresp -hdr "Foo: 1" -body "1"
txresp -hdr "Foo: 1" -body "1"
rxreq
rxreq
txresp -hdr "Foo: 3" -body "3"
txresp -hdr "Foo: 3" -body "3"
rxreq
txresp -hdr "Foo: 9" -body "9"
} -start
} -start
server s2 {
server s2 {
...
@@ -28,19 +30,18 @@ varnish v1 -vcl+backend {
...
@@ -28,19 +30,18 @@ varnish v1 -vcl+backend {
}
}
sub vcl_recv {
sub vcl_recv {
return(pass);
if (req.url == "/nohdr") {
}
set req.backend_hint = h1.backend(req.http.Void);
} else if (req.url == "/emptystring") {
sub vcl_backend_fetch {
set req.backend_hint = h1.backend("");
if (bereq.url == "/nohdr") {
} else if (req.url == "/13") {
set bereq.backend = h1.backend(bereq.http.Void);
set req.backend_hint = h1.backend(req.http.Void + "" + req.url);
} else if (bereq.url == "/emptystring") {
} else if (req.url == "/ip") {
set bereq.backend = h1.backend("");
set req.backend_hint = h1.backend(client.ip);
} else if (bereq.url == "/13") {
set bereq.backend = h1.backend(bereq.http.Void + "" + bereq.url);
} else {
} else {
set
bereq.backend = h1.backend(be
req.url);
set
req.backend_hint = h1.backend(
req.url);
}
}
return (pass);
}
}
} -start
} -start
...
@@ -68,4 +69,8 @@ client c1 {
...
@@ -68,4 +69,8 @@ client c1 {
txreq -url /nohdr
txreq -url /nohdr
rxresp
rxresp
expect resp.http.foo == "8"
expect resp.http.foo == "8"
txreq -url /ip
rxresp
expect resp.http.foo == "9"
} -run
} -run
lib/libvcc/vcc_expr.c
View file @
00bcc3ea
...
@@ -626,6 +626,9 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa)
...
@@ -626,6 +626,9 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa)
}
else
{
}
else
{
vcc_expr0
(
tl
,
&
e2
,
fa
->
type
);
vcc_expr0
(
tl
,
&
e2
,
fa
->
type
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
if
(
e2
->
fmt
!=
fa
->
type
&&
(
fa
->
type
==
STRING
||
fa
->
type
==
STRING_LIST
))
vcc_expr_tostring
(
tl
,
&
e2
,
fa
->
type
);
if
(
e2
->
fmt
!=
fa
->
type
)
{
if
(
e2
->
fmt
!=
fa
->
type
)
{
VSB_printf
(
tl
->
sb
,
"Wrong argument type."
);
VSB_printf
(
tl
->
sb
,
"Wrong argument type."
);
VSB_printf
(
tl
->
sb
,
" Expected %s."
,
VSB_printf
(
tl
->
sb
,
" Expected %s."
,
...
...
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