diff --git a/apache2/apache2_io.c b/apache2/apache2_io.c index 0d59613e4d..c14dd41318 100644 --- a/apache2/apache2_io.c +++ b/apache2/apache2_io.c @@ -208,6 +208,9 @@ apr_status_t read_request_body(modsec_rec *msr, char **error_msg) { * too large and APR_EGENERAL when the client disconnects. */ switch(rc) { + case APR_INCOMPLETE : + *error_msg = apr_psprintf(msr->mp, "Error reading request body: %s", get_apr_error(msr->mp, rc)); + return -7; case APR_EOF : *error_msg = apr_psprintf(msr->mp, "Error reading request body: %s", get_apr_error(msr->mp, rc)); return -6; diff --git a/apache2/mod_security2.c b/apache2/mod_security2.c index 5404fd8744..14e9f44234 100644 --- a/apache2/mod_security2.c +++ b/apache2/mod_security2.c @@ -1030,6 +1030,13 @@ static int hook_request_late(request_rec *r) { r->connection->keepalive = AP_CONN_CLOSE; return HTTP_BAD_REQUEST; break; + case -7 : /* Partial recieved */ + if (my_error_msg != NULL) { + msr_log(msr, 4, "%s", my_error_msg); + } + r->connection->keepalive = AP_CONN_CLOSE; + return HTTP_BAD_REQUEST; + break; default : /* allow through */ break;