1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

core: integrate data_in_{in,out}put_filter to ap_filter_{in,out}put_pending().

Straightforward for ap_filter_input_pending() since c->data_in_input_filter is
always checked wherever ap_run_input_pending(c) is.

For ap_filter_output_pending(), this allows to set c->data_in_output_filter in
ap_process_request_after_handler() and avoid an useless flush from mpm_event.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2018-07-18 22:36:19 +00:00
parent 8a6e1c3ada
commit 8d0a14e3e8
6 changed files with 34 additions and 9 deletions

View File

@@ -403,9 +403,20 @@ AP_DECLARE(void) ap_process_request_after_handler(request_rec *r)
c->data_in_input_filters = (rv == APR_SUCCESS);
apr_brigade_cleanup(bb);
if (c->cs)
c->cs->state = (c->aborted) ? CONN_STATE_LINGER
: CONN_STATE_WRITE_COMPLETION;
if (c->cs) {
if (c->aborted) {
c->cs->state = CONN_STATE_LINGER;
}
else {
/* If we have still data in the output filters here it means that
* the last (recent) nonblocking write was EAGAIN, so tell the MPM
* to not try another useless/stressful one but to go straight to
* POLLOUT.
*/
c->data_in_output_filters = ap_filter_should_yield(c->output_filters);
c->cs->state = CONN_STATE_WRITE_COMPLETION;
}
}
AP_PROCESS_REQUEST_RETURN((uintptr_t)r, r->uri, r->status);
if (ap_extended_status) {
ap_time_process_request(c->sbh, STOP_PREQUEST);
@@ -494,7 +505,7 @@ AP_DECLARE(void) ap_process_request(request_rec *r)
ap_process_async_request(r);
if (!c->data_in_input_filters || ap_run_input_pending(c) != OK) {
if (ap_run_input_pending(c) != OK) {
bb = ap_reuse_brigade_from_pool("ap_pr_bb", c->pool, c->bucket_alloc);
b = apr_bucket_flush_create(c->bucket_alloc);
APR_BRIGADE_INSERT_HEAD(bb, b);