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
af56b5c6
Commit
af56b5c6
authored
Jan 02, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set req.backend_hint from the VCL we switch to.
Spotted by: dridi Fixes: #2175
parent
e3b43c68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+4
-1
r02175.vtc
bin/varnishtest/tests/r02175.vtc
+41
-0
No files found.
bin/varnishd/cache/cache_req_fsm.c
View file @
af56b5c6
...
...
@@ -691,8 +691,11 @@ cnt_recv(struct worker *wrk, struct req *req)
}
VCL_recv_method
(
req
->
vcl
,
wrk
,
req
,
NULL
,
NULL
);
if
(
wrk
->
handling
==
VCL_RET_VCL
)
if
(
wrk
->
handling
==
VCL_RET_VCL
)
{
req
->
director_hint
=
VCL_DefaultDirector
(
req
->
vcl
);
AN
(
req
->
director_hint
);
VCL_recv_method
(
req
->
vcl
,
wrk
,
req
,
NULL
,
NULL
);
}
/* Attempts to cache req.body may fail */
if
(
req
->
req_body_status
==
REQ_BODY_FAIL
)
{
...
...
bin/varnishtest/tests/r02175.vtc
0 → 100644
View file @
af56b5c6
varnishtest "leak backend"
server s1 {
rxreq
txresp -hdr "Leak: no"
} -start
server s2 {
rxreq
txresp -hdr "Leak: yes"
} -start
varnish v1 -vcl {
backend s1 { .host="${s1_addr}"; .port="${s1_port}"; }
sub vcl_deliver {
set resp.http.Label = "yes";
}
}
varnish v1 -cli "vcl.label lbl vcl1"
varnish v1 -vcl {
backend s2 { .host="${s2_addr}"; .port="${s2_port}"; }
sub vcl_recv {
set req.backend_hint = s2;
return (vcl(lbl));
}
sub vcl_deliver {
set resp.http.Label = "no";
}
} -start
client c1 {
txreq
rxresp
expect resp.http.Label == yes
expect resp.http.Leak == no
} -run
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