From 73bcdfae568c3157cfe0f89d47282eeeb9890e44 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 16 Feb 2018 13:04:43 +0000 Subject: [PATCH] mpm_event: follow up to r1823047: complete state validation after processing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824464 13f79535-47bb-0310-9956-ffa450edef68 --- include/httpd.h | 4 +++- server/mpm/event/event.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/httpd.h b/include/httpd.h index 4e42f8b347..d6a4bae22c 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1248,7 +1248,9 @@ typedef enum { CONN_STATE_SUSPENDED, CONN_STATE_LINGER, /* connection may be closed with lingering */ CONN_STATE_LINGER_NORMAL, /* MPM has started lingering close with normal timeout */ - CONN_STATE_LINGER_SHORT /* MPM has started lingering close with short timeout */ + CONN_STATE_LINGER_SHORT, /* MPM has started lingering close with short timeout */ + + CONN_STATE_NUM /* Number of states (keep/kept last) */ } conn_state_e; typedef enum { diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index a58a552ce7..84b2aa0501 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1123,7 +1123,8 @@ read_request: * while this was expected to do lingering close unconditionally with * worker or prefork MPMs for instance. */ - if (rc != OK || (cs->pub.state < CONN_STATE_LINGER + if (rc != OK || (cs->pub.state >= CONN_STATE_NUM) + || (cs->pub.state < CONN_STATE_LINGER && cs->pub.state != CONN_STATE_WRITE_COMPLETION && cs->pub.state != CONN_STATE_CHECK_REQUEST_LINE_READABLE && cs->pub.state != CONN_STATE_SUSPENDED)) { -- 2.50.1