diff options
author | Graham Leggett <minfrin@apache.org> | 2016-02-19 15:00:05 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2016-02-19 15:00:05 +0000 |
commit | 84051c1c9fa812575a94091b224e192118201778 (patch) | |
tree | ab9d2eac03478ef9b9eee1e3c3dc47cd0e86498b /server/util_filter.c | |
parent | e3cc634d1362f6fb35becfec66a6edc842cbb78d (diff) | |
download | httpd-84051c1c9fa812575a94091b224e192118201778.tar.gz |
mpm: Add a complete_connection hook that confirms whether an MPM is allowed
to leave the WRITE_COMPLETION phase. Move filter code out of the MPMs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731253 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_filter.c')
-rw-r--r-- | server/util_filter.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/util_filter.c b/server/util_filter.c index 316a0d0dd0..aaf0173a5a 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -953,6 +953,39 @@ AP_DECLARE(int) ap_filter_should_yield(ap_filter_t *f) return 0; } +AP_DECLARE(int) ap_filter_complete_connection(conn_rec *c) +{ + apr_hash_index_t *rindex; + int data_in_output_filters = DECLINED; + + rindex = apr_hash_first(NULL, c->filters); + while (rindex) { + ap_filter_t *f = apr_hash_this_val(rindex); + + if (!APR_BRIGADE_EMPTY(f->bb)) { + + apr_status_t rv; + + 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(00470) + "write failure in '%s' output filter", f->frec->name); + return rv; + } + + if (ap_filter_should_yield(f)) { + data_in_output_filters = OK; + } + } + + rindex = apr_hash_next(rindex); + } + + return data_in_output_filters; +} + AP_DECLARE_NONSTD(apr_status_t) ap_filter_flush(apr_bucket_brigade *bb, void *ctx) { |