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
e5efc2c8
Commit
e5efc2c8
authored
Feb 06, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement failure in vcl_hash{}
parent
61a15cbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+4
-1
v00051.vtc
bin/varnishtest/tests/v00051.vtc
+26
-0
generate.py
lib/libvcc/generate.py
+1
-1
No files found.
bin/varnishd/cache/cache_req_fsm.c
View file @
e5efc2c8
...
...
@@ -752,7 +752,10 @@ cnt_recv(struct worker *wrk, struct req *req)
SHA256_Init
(
&
sha256ctx
);
VCL_hash_method
(
req
->
vcl
,
wrk
,
req
,
NULL
,
&
sha256ctx
);
assert
(
wrk
->
handling
==
VCL_RET_LOOKUP
);
if
(
wrk
->
handling
==
VCL_RET_FAIL
)
recv_handling
=
wrk
->
handling
;
else
assert
(
wrk
->
handling
==
VCL_RET_LOOKUP
);
SHA256_Final
(
req
->
digest
,
&
sha256ctx
);
switch
(
recv_handling
)
{
...
...
bin/varnishtest/tests/v00051.vtc
View file @
e5efc2c8
...
...
@@ -15,6 +15,11 @@ varnish v1 -vcl+backend {
debug.fail();
}
}
sub vcl_hash {
if (req.http.foo == "hash") {
debug.fail();
}
}
sub vcl_synth {
if (resp.status == 748) {
debug.fail();
...
...
@@ -85,3 +90,24 @@ client c1 {
varnish v1 -expect sc_vcl_failure == 3
logexpect l1 -wait
#######################################################################
# Fail in vcl_hash, no handling in vcl_synth
logexpect l1 -v v1 -g raw {
expect * 1009 VCL_call "HASH"
expect 0 1009 Debug "Forced failure"
expect 0 1009 VCL_return "fail"
} -start
client c1 {
txreq -hdr "foo: hash"
rxresp
expect resp.status == 503
expect resp.reason == "VCL failed"
} -run
varnish v1 -expect sc_vcl_failure == 4
logexpect l1 -wait
lib/libvcc/generate.py
View file @
e5efc2c8
...
...
@@ -102,7 +102,7 @@ returns = (
),
(
'hash'
,
"C"
,
(
'lookup'
,)
(
'
fail'
,
'
lookup'
,)
),
(
'purge'
,
"C"
,
...
...
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