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
c9db023f
Commit
c9db023f
authored
Apr 09, 2013
by
Poul-Henning Kamp
Committed by
Tollef Fog Heen
Apr 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return false if req.backend.health is accessed in vcl_deliver{} where
this information is no longer available. Fixes #1228
parent
3b49dc9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
cache_vrt_var.c
bin/varnishd/cache_vrt_var.c
+6
-0
r01228.vcl
bin/varnishtest/tests/r01228.vcl
+18
-0
No files found.
bin/varnishd/cache_vrt_var.c
View file @
c9db023f
...
...
@@ -536,6 +536,12 @@ unsigned
VRT_r_req_backend_healthy
(
const
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
/*
* XXX: Not optimal, but we do not have a backend in vcl_deliver
* XXX: and we have to return something.
*/
if
(
sp
->
director
==
NULL
)
return
(
0
);
CHECK_OBJ_NOTNULL
(
sp
->
director
,
DIRECTOR_MAGIC
);
return
(
VDI_Healthy
(
sp
->
director
,
sp
));
}
...
...
bin/varnishtest/tests/r01228.vcl
0 → 100644
View file @
c9db023f
varnishtest "req.backend.healthy in vcl_deliver"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_deliver {
set resp.http.x-foo = req.backend.healthy;
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
} -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