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)
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
* 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);