diff options
author | Graham Leggett <minfrin@apache.org> | 2015-10-04 12:10:51 +0200 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2015-10-04 12:10:51 +0200 |
commit | 615f97f93364fd7189ce973478266ce3d229d76b (patch) | |
tree | 84b9f0601b3a3ba6ecb0caf794378d7019f850e5 /server/mpm/motorz/motorz.c | |
parent | leave LoadModule of mod_http2 commented-out by default (diff) | |
download | apache2-615f97f93364fd7189ce973478266ce3d229d76b.tar.xz apache2-615f97f93364fd7189ce973478266ce3d229d76b.zip |
core: Extend support for asynchronous write completion from the
network filter to any connection or request filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706669 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm/motorz/motorz.c')
-rw-r--r-- | server/mpm/motorz/motorz.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/server/mpm/motorz/motorz.c b/server/mpm/motorz/motorz.c index f359dbafb9..a10ead0f59 100644 --- a/server/mpm/motorz/motorz.c +++ b/server/mpm/motorz/motorz.c @@ -359,21 +359,38 @@ static apr_status_t motorz_io_process(motorz_conn_t *scon) } if (scon->cs.state == CONN_STATE_WRITE_COMPLETION) { - ap_filter_t *output_filter = c->output_filters; - ap_update_child_status_from_conn(scon->sbh, SERVER_BUSY_WRITE, c); - while (output_filter->next != NULL) { - output_filter = output_filter->next; - } + apr_hash_index_t *rindex; + apr_status_t rv = APR_SUCCESS; + int data_in_output_filters = 0; + ap_update_child_status_from_conn(sbh, SERVER_BUSY_WRITE, c); + + rindex = apr_hash_first(NULL, c->filters); + while (rindex) { + ap_filter_t *f = apr_hash_this_val(rindex); + + if (!APR_BRIGADE_EMPTY(f->bb)) { + + rv = ap_pass_brigade(f, c->empty); + apr_brigade_cleanup(c->empty); + if (APR_SUCCESS != rv) { + ap_log_cerror( + APLOG_MARK, APLOG_DEBUG, rv, c, APLOGNO(02848) + "write failure in '%s' output filter", f->frec->name); + break; + } + + if (ap_filter_should_yield(f)) { + data_in_output_filters = 1; + } + } - rv = output_filter->frec->filter_func.out_func(output_filter, - NULL); + rindex = apr_hash_next(rindex); + } if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02848) - "network write failure in core output filter"); scon->cs.state = CONN_STATE_LINGER; } - else if (c->data_in_output_filters) { + else if (data_in_output_filters) { /* Still in WRITE_COMPLETION_STATE: * Set a write timeout for this connection, and let the * event thread poll for writeability. |