diff options
author | Stefan Eissing <icing@apache.org> | 2023-06-29 11:28:24 +0200 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2023-06-29 11:28:24 +0200 |
commit | 7ca5e6b04d9391e31cc73749d674c189006f60d5 (patch) | |
tree | 02867b165a75e9bb884f3f7ea60c09bc0de08e40 /modules/http2/h2_c2.c | |
parent | pyhttpd: Generate core dumps on crash and show them in the ci eventually. (diff) | |
download | apache2-7ca5e6b04d9391e31cc73749d674c189006f60d5.tar.xz apache2-7ca5e6b04d9391e31cc73749d674c189006f60d5.zip |
mod_http2: move get_pollfd_from_conn hook outside the HAS_RESPONSE_BUCKET part
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910685 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/http2/h2_c2.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/modules/http2/h2_c2.c b/modules/http2/h2_c2.c index 783a297fe0..9ca888f9e4 100644 --- a/modules/http2/h2_c2.c +++ b/modules/http2/h2_c2.c @@ -469,6 +469,33 @@ static int c2_hook_fixups(request_rec *r) return DECLINED; } +#if H2_USE_POLLFD_FROM_CONN +static apr_status_t c2_get_pollfd_from_conn(conn_rec *c, + struct apr_pollfd_t *pfd, + apr_interval_time_t *ptimeout) +{ + if (c->master) { + h2_conn_ctx_t *ctx = h2_conn_ctx_get(c); + if (ctx) { + if (ctx->beam_in && ctx->pipe_in[H2_PIPE_OUT]) { + pfd->desc_type = APR_POLL_FILE; + pfd->desc.f = ctx->pipe_in[H2_PIPE_OUT]; + if (ptimeout) + *ptimeout = h2_beam_timeout_get(ctx->beam_in); + } + else { + /* no input */ + pfd->desc_type = APR_NO_DESC; + if (ptimeout) + *ptimeout = -1; + } + return APR_SUCCESS; + } + } + return APR_ENOTIMPL; +} +#endif + #if AP_HAS_RESPONSE_BUCKETS static void c2_pre_read_request(request_rec *r, conn_rec *c2) @@ -559,33 +586,6 @@ static int c2_hook_pre_connection(conn_rec *c2, void *csd) return OK; } -#if H2_USE_POLLFD_FROM_CONN -static apr_status_t c2_get_pollfd_from_conn(conn_rec *c, - struct apr_pollfd_t *pfd, - apr_interval_time_t *ptimeout) -{ - if (c->master) { - h2_conn_ctx_t *ctx = h2_conn_ctx_get(c); - if (ctx) { - if (ctx->beam_in && ctx->pipe_in[H2_PIPE_OUT]) { - pfd->desc_type = APR_POLL_FILE; - pfd->desc.f = ctx->pipe_in[H2_PIPE_OUT]; - if (ptimeout) - *ptimeout = h2_beam_timeout_get(ctx->beam_in); - } - else { - /* no input */ - pfd->desc_type = APR_NO_DESC; - if (ptimeout) - *ptimeout = -1; - } - return APR_SUCCESS; - } - } - return APR_ENOTIMPL; -} -#endif - void h2_c2_register_hooks(void) { /* When the connection processing actually starts, we might @@ -912,6 +912,10 @@ void h2_c2_register_hooks(void) * install our own. This needs to be done very early. */ ap_hook_post_read_request(h2_c2_hook_post_read_request, NULL, NULL, APR_HOOK_REALLY_FIRST); ap_hook_fixups(c2_hook_fixups, NULL, NULL, APR_HOOK_LAST); +#if H2_USE_POLLFD_FROM_CONN + ap_hook_get_pollfd_from_conn(c2_get_pollfd_from_conn, NULL, NULL, + APR_HOOK_MIDDLE); +#endif ap_register_input_filter("H2_C2_NET_IN", h2_c2_filter_in, NULL, AP_FTYPE_NETWORK); |