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
0bd10ea0
Commit
0bd10ea0
authored
Jul 29, 2014
by
Poul-Henning Kamp
Committed by
Lasse Karstensen
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly fail bad reads in req.body
Spotted and fixed by: Nils Goroll Fixes #1562
parent
7a4fe100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
cache_http1_fsm.c
bin/varnishd/cache/cache_http1_fsm.c
+4
-0
r01562.vtc
bin/varnishtest/tests/r01562.vtc
+49
-0
No files found.
bin/varnishd/cache/cache_http1_fsm.c
View file @
0bd10ea0
...
...
@@ -559,6 +559,10 @@ HTTP1_IterateReqBody(struct req *req, req_body_iter_f *func, void *priv)
VSLb
(
req
->
vsl
,
SLT_VCL_Error
,
"Uncached req.body can only be consumed once."
);
return
(
-
1
);
case
REQ_BODY_FAIL
:
VSLb
(
req
->
vsl
,
SLT_FetchError
,
"Had failed reading req.body before."
);
return
(
-
1
);
default:
WRONG
(
"Wrong req_body_status in HTTP1_IterateReqBody()"
);
}
...
...
bin/varnishtest/tests/r01562.vtc
0 → 100644
View file @
0bd10ea0
varnishtest "retrying a short client body read should not panic varnish"
server s1 {
non-fatal
rxreq
txresp -status 200 -hdr "Foo: BAR" -body "1234"
} -start
server s2 {
non-fatal
rxreq
txresp -status 200 -hdr "Foo: Foo" -body "56"
} -start
varnish v1 -cliok "param.set vcc_allow_inline_c true" -vcl+backend {
sub vcl_recv {
return (pass);
}
sub vcl_backend_fetch {
if (bereq.retries >= 1) {
set bereq.backend = s2;
} else {
set bereq.backend = s1;
}
}
sub vcl_backend_error {
return (retry);
}
} -start
varnish v1 -cliok "param.set debug +syncvsl"
client c1 {
txreq -req "POST" -nolen -hdr "Content-Length: 10000" -bodylen 9999
} -run
delay .4
server s1 {
rxreq
txresp -status 200 -bodylen 11
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 11
} -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