From: Yann Ylavic Date: Thu, 22 Jul 2021 16:01:43 +0000 (+0000) Subject: mpm_event: clear APR_INCOMPLETE_READ on lingering close. X-Git-Tag: 2.5.0-alpha2-ci-test-only~884 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2515db492e98bca96b2510c1fb792ba47b65e1f0;p=thirdparty%2Fapache%2Fhttpd.git mpm_event: clear APR_INCOMPLETE_READ on lingering close. * server/mpm/event/event.c (process_lingering_close): APR_INCOMPLETE_READ may have been set anytime while processing the connection, clear it before nonblocking apr_socket_recv() to prevent internal apr_poll(). Follow up to r1891716. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891726 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 79c5f8cfa15..e77da8b2b98 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1693,6 +1693,10 @@ static void process_lingering_close(event_conn_state_t *cs) } cs->queue_timestamp = apr_time_now(); + /* Clear APR_INCOMPLETE_READ if it was ever set, we'll do the poll() + * at the listener only from now, if needed. + */ + apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 0); /* * If some module requested a shortened waiting period, only wait for * 2s (SECONDS_TO_LINGER). This is useful for mitigating certain