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
49d32683
Unverified
Commit
49d32683
authored
Nov 12, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bereq.is_hitpass and bereq.is_hitmiss
as copies of the respective client side flags
parent
8afbf7f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+3
-0
c00075.vtc
bin/varnishtest/tests/c00075.vtc
+10
-0
vcl_var.rst
doc/sphinx/reference/vcl_var.rst
+16
-0
bo_flags.h
include/tbl/bo_flags.h
+2
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
49d32683
...
...
@@ -1114,6 +1114,9 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
WRONG
(
"Wrong fetch mode"
);
}
bo
->
is_hitpass
=
req
->
is_hitpass
;
bo
->
is_hitmiss
=
req
->
is_hitmiss
;
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u %s"
,
VXID
(
req
->
vsl
->
wid
),
how
);
VSLb
(
bo
->
vsl
,
SLT_VCL_use
,
"%s"
,
VCL_Name
(
bo
->
vcl
));
VSLb
(
req
->
vsl
,
SLT_Link
,
"bereq %u %s"
,
VXID
(
bo
->
vsl
->
wid
),
how
);
...
...
bin/varnishtest/tests/c00075.vtc
View file @
49d32683
...
...
@@ -53,6 +53,8 @@ server s1 {
varnish v1 \
-arg "-s default,1m" -vcl+backend {
sub vcl_backend_response {
set beresp.http.be-hitmiss = bereq.is_hitmiss;
set beresp.http.be-hitpass = bereq.is_hitpass;
if (bereq.url == "/hfp") {
return (pass(10m));
}
...
...
@@ -75,6 +77,8 @@ client c1 {
expect resp.bodylen == 65536
expect resp.http.is-hitmiss == false
expect resp.http.is-hitpass == false
expect resp.http.be-hitmiss == resp.http.is-hitmiss
expect resp.http.be-hitpass == resp.http.is-hitpass
expect_pattern
} -start
...
...
@@ -98,6 +102,8 @@ client c1 {
expect resp.bodylen == 65536
expect resp.http.is-hitmiss == true
expect resp.http.is-hitpass == false
expect resp.http.be-hitmiss == resp.http.is-hitmiss
expect resp.http.be-hitpass == resp.http.is-hitpass
expect_pattern
} -start
...
...
@@ -122,6 +128,8 @@ client c1 {
expect resp.bodylen == 65536
expect resp.http.is-hitmiss == false
expect resp.http.is-hitpass == false
expect resp.http.be-hitmiss == resp.http.is-hitmiss
expect resp.http.be-hitpass == resp.http.is-hitpass
expect_pattern
} -start
...
...
@@ -145,6 +153,8 @@ client c1 {
expect resp.bodylen == 65536
expect resp.http.is-hitmiss == false
expect resp.http.is-hitpass == true
expect resp.http.be-hitmiss == resp.http.is-hitmiss
expect resp.http.be-hitpass == resp.http.is-hitpass
expect_pattern
} -start
...
...
doc/sphinx/reference/vcl_var.rst
View file @
49d32683
...
...
@@ -650,6 +650,22 @@ bereq.is_bgfetch
grace, and this fetch was kicked of in the background to get
a fresh copy.
bereq.is_hitmiss
Type: BOOL
Readable from: backend
If this backend request was caused by a hitmiss.
bereq.is_hitpass
Type: BOOL
Readable from: backend
If this backend request was caused by a hitpass.
beresp
~~~~~~
...
...
include/tbl/bo_flags.h
View file @
49d32683
...
...
@@ -43,6 +43,8 @@ BO_FLAG(do_pass, 0, 0, 0, 0, "")
BO_FLAG
(
uncacheable
,
0
,
0
,
0
,
0
,
""
)
BO_FLAG
(
was_304
,
0
,
1
,
0
,
0
,
""
)
BO_FLAG
(
is_bgfetch
,
1
,
0
,
0
,
0
,
""
)
BO_FLAG
(
is_hitmiss
,
1
,
0
,
0
,
0
,
""
)
BO_FLAG
(
is_hitpass
,
1
,
0
,
0
,
0
,
""
)
#undef BO_FLAG
/*lint -restore */
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