From: Yann Ylavic Date: Fri, 16 Feb 2018 13:04:43 +0000 (+0000) Subject: mpm_event: follow up to r1823047: complete state validation after processing. X-Git-Tag: 2.5.0-alpha2-ci-test-only~2852 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73bcdfae568c3157cfe0f89d47282eeeb9890e44;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/include/httpd.h b/include/httpd.h index 4e42f8b3470..d6a4bae22c3 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 a58a552ce7d..84b2aa0501e 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)) {