diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c index ff01d55a5a1..ea400eb7776 100644 --- a/bin/varnishd/cache/cache_req_body.c +++ b/bin/varnishd/cache/cache_req_body.c @@ -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); diff --git a/bin/varnishtest/tests/c00067.vtc b/bin/varnishtest/tests/c00067.vtc index c9533e3a05b..b14e65c3736 100644 --- a/bin/varnishtest/tests/c00067.vtc +++ b/bin/varnishtest/tests/c00067.vtc @@ -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 {