]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.
authorYann Ylavic <ylavic@apache.org>
Tue, 28 May 2024 14:10:43 +0000 (14:10 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 28 May 2024 14:10:43 +0000 (14:10 +0000)
commitc0a30141cad8ee5541a8c73b4b19f7a6a78f979b
tree4fdd4c2dbe9fc63874e6c3ebe7d2b775092c0e9b
parent03162f8746a4e7fa0f349688a8347e87e967c94c
 mpm_event,core: Handle async POLLIN/POLLOUT in CONN_STATE_PROCESS state.

* include/httpd.h:
  Rename CONN_STATE_CHECK_REQUEST_LINE_READABLE to CONN_STATE_KEEPALIVE
  and CONN_STATE_READ_REQUEST_LINE to CONN_STATE_PROCESS, keeping the
  old enums as aliases. Rework comments about each state.

* server/mpm/event/event.c:
  Use the new states names.
  Let the process_connection hooks return CONN_STATE_PROCESS for mpm_event
  to POLLIN or POLLOUT depending on c->cs->sense being CONN_SENSE_WANT_READ
  or CONN_SENSE_WANT_WRITE respectively.
  Remove (ab)use of CONN_STATE_WRITE_COMPLETION with CONN_SENSE_WANT_READ to
  mean poll() for read (and the need for the obscure c->clogging_input_filters
  to make it work as expected). This is what CONN_STATE_PROCESS is for now.
  Update the comment about the states that can be returned by process_connection
  hooks (and their usage).
  Use the same queue (process_q renamed from write_completion_q) for polling
  connections in both CONN_STATE_PROCESS and CONN_STATE_WRITE_COMPLETION
  states since they both use the same (server_rec's) Timeout. This implies
  that both states are accounted as "write-completion" in mod_status for now.

* server/mpm/motorz/motorz.c, server/mpm/simple/simple_io.c, modules/http/http_core.c:
  Use the new states names (only).

* include/scoreboard.h:
  Change comment about process_score->write_completion to note that the
  counter refers to CONN_STATE_PROCESS connections returned to the MPM
  too.

* modules/http2/h2_c1.c:
  Return the c1 connection with the CONN_STATE_PROCESS state rather than
  CONN_STATE_WRITE_COMPLETION when waiting for a window update (i.e. ask
  the MPM to poll for read directly). This avoids the transition to
  CONN_STATE_KEEPALIVE which could kill the connection under high load.

Github: closes #448

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918022 13f79535-47bb-0310-9956-ffa450edef68
include/httpd.h
include/scoreboard.h
modules/http/http_core.c
modules/http2/h2_c1.c
server/mpm/event/event.c
server/mpm/motorz/motorz.c
server/mpm/simple/simple_io.c