Skip to content

Commit

Permalink
Fix cached request body size limitation with chunked TE
Browse files Browse the repository at this point in the history
With varnishcache#3809 in place, we can now differentiate properly between the cache
size being exactly right and too small.
  • Loading branch information
nigoroll committed May 29, 2022
1 parent e48b7ef commit 49bae51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/varnishd/cache/cache_req_body.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ vrb_pull(struct req *req, ssize_t maxsize, unsigned partial,
} while (vfps == VFP_OK && (maxsize < 0 || req_bodybytes < maxsize));

if (!partial) {
if (maxsize >= 0 && req_bodybytes > maxsize)
if (vfps == VFP_OK)
(void)VFP_Error(vfc, "Request body too big to cache");

req->acct.req_bodybytes += VFP_Close(vfc);
Expand Down
2 changes: 1 addition & 1 deletion bin/varnishtest/tests/c00067.vtc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ logexpect l3 -v v1 -g vxid -q {ReqURL ~ "^/3"} {

logexpect l4 -v v1 -g vxid -q {ReqURL ~ "^/4"} {
expect * * FetchError {^Request body too big to cache}
expect * = ReqAcct {^\d+ 111 }
expect * = ReqAcct {^\d+ 110 }
} -start

client c1 {
Expand Down

0 comments on commit 49bae51

Please sign in to comment.