From 06d60bd8bd624cebc215271f49a9046924f23c02 Mon Sep 17 00:00:00 2001 From: brenosilva Date: Wed, 4 May 2011 16:49:11 +0000 Subject: [PATCH] Fix issue counting requet body len --- apache2/apache2_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apache2/apache2_io.c b/apache2/apache2_io.c index 6b61f7a4..b080b1c2 100644 --- a/apache2/apache2_io.c +++ b/apache2/apache2_io.c @@ -267,6 +267,8 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) { modsecurity_request_body_to_stream(msr, buf, buflen, error_msg); } + msr->reqbody_length += buflen; + if (buflen != 0) { int rcbs = modsecurity_request_body_store(msr, buf, buflen, error_msg); if (rcbs < 0) { @@ -298,7 +300,6 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) { return -1; } - msr->reqbody_length += buflen; } if (APR_BUCKET_IS_EOS(bucket)) {