summaryrefslogtreecommitdiffstats
path: root/server/mpm
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-07-20 17:47:16 +0200
committerYann Ylavic <ylavic@apache.org>2018-07-20 17:47:16 +0200
commit3fdba065dd16a9eafdf1997ba89277da195a66a9 (patch)
treec45749677cec2e275a67178d50b0e251b120c150 /server/mpm
parentcore: follow up to r1836237: core filter's tmp_flush_bb not used anymore. (diff)
downloadapache2-3fdba065dd16a9eafdf1997ba89277da195a66a9.tar.xz
apache2-3fdba065dd16a9eafdf1997ba89277da195a66a9.zip
core: axe data_in_in/output_filter from conn_rec.
They were superseded by ap_filter_should_yield() and ap_run_in/output_pending() in r1706669 and had poor semantics since then (we can't maintain pending semantics both by filter and for the whole connection). Register ap_filter_input_pending() as the default input_pending hook (which seems to have been forgotten in the first place). On the MPM event side, we don't need to flush pending output data when the connection has just been processed, ap_filter_should_yield() is lightweight and enough to determine whether we should really enter write completion state or go straight to reading. ap_run_output_pending() is used only when write completion is in place and needs to be completed before more processing. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836364 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r--server/mpm/event/event.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index fcc42a64c9..27071b1e37 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -992,7 +992,7 @@ static void process_socket(apr_thread_t *thd, apr_pool_t * p, apr_socket_t * soc
{
conn_rec *c;
long conn_id = ID_FROM_CHILD_THREAD(my_child_num, my_thread_num);
- int clogging = 0;
+ int clogging = 0, from_wc_q = 0;
apr_status_t rv;
int rc = OK;
@@ -1094,6 +1094,9 @@ read_request:
rc = OK;
}
}
+ else if (cs->pub.state == CONN_STATE_WRITE_COMPLETION) {
+ from_wc_q = 1;
+ }
}
/*
* The process_connection hooks above should set the connection state
@@ -1137,11 +1140,17 @@ read_request:
}
if (cs->pub.state == CONN_STATE_WRITE_COMPLETION) {
- int pending;
+ int pending = DECLINED;
ap_update_child_status(cs->sbh, SERVER_BUSY_WRITE, NULL);
- pending = ap_run_output_pending(c);
+ if (from_wc_q) {
+ from_wc_q = 0; /* one shot */
+ pending = ap_run_output_pending(c);
+ }
+ else if (ap_filter_should_yield(c->output_filters)) {
+ pending = OK;
+ }
if (pending == OK) {
/* Still in WRITE_COMPLETION_STATE:
* Set a write timeout for this connection, and let the