From: Stefan Eissing Date: Wed, 16 Mar 2016 11:06:28 +0000 (+0000) Subject: reverting r1735174 as http/1.1 just terminated before response X-Git-Tag: 2.5.0-alpha~1889 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a54010ad2dd0cb37cb7516f3ec55e6a4f9fad05;p=apache reverting r1735174 as http/1.1 just terminated before response git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735216 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 881dfc3c09..b2394beab7 100644 --- a/CHANGES +++ b/CHANGES @@ -3,10 +3,7 @@ Changes with Apache 2.5.0 *) mod_http: Make sure HTTP filters are added on HTTP requests only. [Graham Leggett] - - *) mpm: Generalise the ap_mpm_register_socket functions to accept pipes - or sockets. [Graham Leggett] - + *) mod_rewrite: Don't implicitly URL-escape the original query string when no substitution has changed it (like PR50447 but server context) [Evgeny Kotkov ] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index a62f93f4cc..1140f3a4f1 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -510,19 +510,12 @@ * 20160312.0 (2.5.0-dev) Rename complete_connection to output_pending, * add ap_filter_input_pending(), * ap_filter_prepare_brigade(), ap_filter_direction_e - * 20160315.0 (2.5.0-dev) Rename ap_mpm_register_socket_callback, - * ap_mpm_register_socket_callback_timeout and - * ap_mpm_unregister_socket_callback to - * ap_mpm_register_poll_callback, - * ap_mpm_register_poll_callback_timeout and - * ap_mpm_unregister_poll_callback. Add - * AP_MPMQ_CAN_POLL. */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 20160315 +#define MODULE_MAGIC_NUMBER_MAJOR 20160312 #endif #define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ diff --git a/include/ap_mpm.h b/include/ap_mpm.h index d844a02c89..d50acd95e3 100644 --- a/include/ap_mpm.h +++ b/include/ap_mpm.h @@ -180,8 +180,6 @@ AP_DECLARE(apr_status_t) ap_os_create_privileged_process( #define AP_MPMQ_HAS_SERF 16 /** MPM supports suspending/resuming connections */ #define AP_MPMQ_CAN_SUSPEND 17 -/** MPM supports additional pollfds */ -#define AP_MPMQ_CAN_POLL 18 /** @} */ /** @@ -204,56 +202,55 @@ typedef void (ap_mpm_callback_fn_t)(void *baton); /* only added support in the Event MPM.... check for APR_ENOTIMPL */ AP_DECLARE(apr_status_t) ap_mpm_resume_suspended(conn_rec *c); /* only added support in the Event MPM.... check for APR_ENOTIMPL */ -AP_DECLARE(apr_status_t) ap_mpm_register_timed_callback( - apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton); +AP_DECLARE(apr_status_t) ap_mpm_register_timed_callback(apr_time_t t, + ap_mpm_callback_fn_t *cbfn, + void *baton); /** - * Register a callback on the readability or writability on a group of - * sockets/pipes. - * @param pfds Array of apr_pollfd_t + * Register a callback on the readability or writability on a group of sockets + * @param s Null-terminated list of sockets * @param p pool for use between registration and callback + * @param for_read Whether the sockets are monitored for read or writability * @param cbfn The callback function * @param baton userdata for the callback function - * @return APR_SUCCESS if all sockets/pipes could be added to a pollset, + * @return APR_SUCCESS if all sockets could be added to a pollset, * APR_ENOTIMPL if no asynch support, or an apr_pollset_add error. - * @remark When activity is found on any 1 socket/pipe in the list, all are removed + * @remark When activity is found on any 1 socket in the list, all are removed * from the pollset and only 1 callback is issued. */ -AP_DECLARE(apr_status_t) ap_mpm_register_poll_callback(apr_array_header_t *pds, - ap_mpm_callback_fn_t *cbfn, void *baton); - -/** - * Register a callback on the readability or writability on a group of sockets/pipes, - * with a timeout. - * @param pfds Array of apr_pollfd_t +AP_DECLARE(apr_status_t) ap_mpm_register_socket_callback(apr_socket_t **s, + apr_pool_t *p, + int for_read, + ap_mpm_callback_fn_t *cbfn, + void *baton); + /** + * Register a callback on the readability or writability on a group of sockets, with a timeout + * @param s Null-terminated list of sockets * @param p pool for use between registration and callback + * @param for_read Whether the sockets are monitored for read or writability * @param cbfn The callback function * @param tofn The callback function if the timeout expires * @param baton userdata for the callback function * @param timeout timeout for I/O in microseconds, unlimited if <= 0 - * @return APR_SUCCESS if all sockets/pipes could be added to a pollset, + * @return APR_SUCCESS if all sockets could be added to a pollset, * APR_ENOTIMPL if no asynch support, or an apr_pollset_add error. - * @remark When activity is found on any 1 socket/pipe in the list, all are removed + * @remark When activity is found on any 1 socket in the list, all are removed * from the pollset and only 1 callback is issued. * @remark For each call, only one of tofn or cbfn will be called, never both. */ -AP_DECLARE(apr_status_t) ap_mpm_register_poll_callback_timeout( - apr_array_header_t *pfds, ap_mpm_callback_fn_t *cbfn, - ap_mpm_callback_fn_t *tofn, void *baton, apr_time_t timeout); +AP_DECLARE(apr_status_t) ap_mpm_register_socket_callback_timeout(apr_socket_t **s, + apr_pool_t *p, + int for_read, + ap_mpm_callback_fn_t *cbfn, + ap_mpm_callback_fn_t *tofn, + void *baton, + apr_time_t timeout); -/** -* Unregister a previously registered callback. -* @param pfds Array of apr_pollfd_t -* @param p pool for use between registration and callback -* @return APR_SUCCESS if all sockets/pipes could be removed from the pollset, -* APR_ENOTIMPL if no asynch support, or an apr_pollset_remove error. -* @remark This function triggers the cleanup registered on the pool p during -* callback registration. -*/ -AP_DECLARE(apr_status_t) ap_mpm_unregister_poll_callback(apr_array_header_t *pfds); +AP_DECLARE(apr_status_t) ap_mpm_unregister_socket_callback(apr_socket_t **s, + apr_pool_t *p); typedef enum mpm_child_status { MPM_CHILD_STARTED, diff --git a/include/mpm_common.h b/include/mpm_common.h index b366a08b12..0b70b71937 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -426,26 +426,25 @@ AP_DECLARE_HOOK(apr_status_t, mpm_register_timed_callback, * register the specified callback * @ingroup hooks */ -AP_DECLARE_HOOK(apr_status_t, mpm_register_poll_callback, - (apr_array_header_t *pds, ap_mpm_callback_fn_t *cbfn, void *baton)) +AP_DECLARE_HOOK(apr_status_t, mpm_register_socket_callback, + (apr_socket_t **s, apr_pool_t *p, int for_read, ap_mpm_callback_fn_t *cbfn, void *baton)) /* register the specified callback, with timeout * @ingroup hooks * */ -AP_DECLARE_HOOK(apr_status_t, mpm_register_poll_callback_timeout, - (apr_array_header_t *pds, - ap_mpm_callback_fn_t *cbfn, - ap_mpm_callback_fn_t *tofn, - void *baton, - apr_time_t timeout)) - +AP_DECLARE_HOOK(apr_status_t, mpm_register_socket_callback_timeout, + (apr_socket_t **s, apr_pool_t *p, int for_read, + ap_mpm_callback_fn_t *cbfn, + ap_mpm_callback_fn_t *tofn, + void *baton, + apr_time_t timeout)) /** * Unregister the specified callback * @ingroup hooks */ -AP_DECLARE_HOOK(apr_status_t, mpm_unregister_poll_callback, - (apr_array_header_t *pds)) +AP_DECLARE_HOOK(apr_status_t, mpm_unregister_socket_callback, + (apr_socket_t **s, apr_pool_t *p)) /** Resume the suspended connection * @ingroup hooks diff --git a/modules/proxy/mod_proxy_wstunnel.c b/modules/proxy/mod_proxy_wstunnel.c index 82fdaf0127..0e92011b27 100644 --- a/modules/proxy/mod_proxy_wstunnel.c +++ b/modules/proxy/mod_proxy_wstunnel.c @@ -20,7 +20,7 @@ module AP_MODULE_DECLARE_DATA proxy_wstunnel_module; typedef struct { - int mpm_can_poll; + signed char is_async; apr_time_t idle_timeout; apr_time_t async_delay; } proxyws_dir_conf; @@ -39,7 +39,7 @@ typedef struct ws_baton_t { static void proxy_wstunnel_callback(void *b); -static int proxy_wstunnel_pump(ws_baton_t *baton, apr_time_t timeout, int try_poll) { +static int proxy_wstunnel_pump(ws_baton_t *baton, apr_time_t timeout, int try_async) { request_rec *r = baton->r; conn_rec *c = r->connection; proxy_conn_rec *conn = baton->proxy_connrec; @@ -62,7 +62,7 @@ static int proxy_wstunnel_pump(ws_baton_t *baton, apr_time_t timeout, int try_po continue; } else if (APR_STATUS_IS_TIMEUP(rv)) { - if (try_poll) { + if (try_async) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(02542) "Attempting to go async"); return SUSPENDED; } @@ -182,28 +182,15 @@ static void proxy_wstunnel_cancel_callback(void *b) */ static void proxy_wstunnel_callback(void *b) { int status; + apr_socket_t *sockets[3] = {NULL, NULL, NULL}; ws_baton_t *baton = (ws_baton_t*)b; proxyws_dir_conf *dconf = ap_get_module_config(baton->r->per_dir_config, &proxy_wstunnel_module); apr_pool_clear(baton->subpool); - status = proxy_wstunnel_pump(baton, dconf->async_delay, dconf->mpm_can_poll); + status = proxy_wstunnel_pump(baton, dconf->async_delay, dconf->is_async); if (status == SUSPENDED) { - apr_pollfd_t *pfd; - - apr_array_header_t *pfds = apr_array_make(baton->subpool, 2, sizeof(apr_pollfd_t)); - - pfd = apr_array_push(pfds); - pfd->desc_type = APR_POLL_SOCKET; - pfd->reqevents = APR_POLLIN | APR_POLLERR | APR_POLLHUP; - pfd->desc.s = baton->client_soc; - pfd->p = baton->subpool; - - pfd = apr_array_push(pfds); - pfd->desc_type = APR_POLL_SOCKET; - pfd->reqevents = APR_POLLIN | APR_POLLERR | APR_POLLHUP; - pfd->desc.s = baton->server_soc; - pfd->p = baton->subpool; - - ap_mpm_register_poll_callback_timeout(pfds, + sockets[0] = baton->client_soc; + sockets[1] = baton->server_soc; + ap_mpm_register_socket_callback_timeout(sockets, baton->subpool, 1, proxy_wstunnel_callback, proxy_wstunnel_cancel_callback, baton, @@ -311,6 +298,7 @@ static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r, apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc); apr_socket_t *client_socket = ap_get_conn_socket(c); ws_baton_t *baton = apr_pcalloc(r->pool, sizeof(ws_baton_t)); + apr_socket_t *sockets[3] = {NULL, NULL, NULL}; int status; proxyws_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &proxy_wstunnel_module); @@ -382,30 +370,16 @@ static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r, baton->scheme = scheme; apr_pool_create(&baton->subpool, r->pool); - if (!dconf->mpm_can_poll) { - status = proxy_wstunnel_pump(baton, dconf->idle_timeout, dconf->mpm_can_poll); + if (!dconf->is_async) { + status = proxy_wstunnel_pump(baton, dconf->idle_timeout, dconf->is_async); } else { - status = proxy_wstunnel_pump(baton, dconf->async_delay, dconf->mpm_can_poll); + status = proxy_wstunnel_pump(baton, dconf->async_delay, dconf->is_async); apr_pool_clear(baton->subpool); if (status == SUSPENDED) { - apr_pollfd_t *pfd; - - apr_array_header_t *pfds = apr_array_make(baton->subpool, 2, sizeof(apr_pollfd_t)); - - pfd = apr_array_push(pfds); - pfd->desc_type = APR_POLL_SOCKET; - pfd->reqevents = APR_POLLIN | APR_POLLERR | APR_POLLHUP; - pfd->desc.s = baton->client_soc; - pfd->p = baton->subpool; - - pfd = apr_array_push(pfds); - pfd->desc_type = APR_POLL_SOCKET; - pfd->reqevents = APR_POLLIN | APR_POLLERR | APR_POLLHUP; - pfd->desc.s = baton->server_soc; - pfd->p = baton->subpool; - - rv = ap_mpm_register_poll_callback_timeout(pfds, + sockets[0] = baton->client_soc; + sockets[1] = baton->server_soc; + rv = ap_mpm_register_socket_callback_timeout(sockets, baton->subpool, 1, proxy_wstunnel_callback, proxy_wstunnel_cancel_callback, baton, @@ -530,8 +504,6 @@ static void *create_proxyws_dir_config(apr_pool_t *p, char *dummy) new->idle_timeout = -1; /* no timeout */ - ap_mpm_query(AP_MPMQ_CAN_POLL, &new->mpm_can_poll); - return (void *) new; } @@ -552,11 +524,15 @@ static const char * proxyws_set_aysnch_delay(cmd_parms *cmd, void *conf, const c static const command_rec ws_proxy_cmds[] = { + AP_INIT_FLAG("ProxyWebsocketAsync", ap_set_flag_slot_char, (void*)APR_OFFSETOF(proxyws_dir_conf, is_async), + RSRC_CONF|ACCESS_CONF, + "on if idle websockets connections should be monitored asyncronously"), + AP_INIT_TAKE1("ProxyWebsocketIdleTimeout", proxyws_set_idle, NULL, RSRC_CONF|ACCESS_CONF, "timeout for activity in either direction, unlimited by default"), AP_INIT_TAKE1("ProxyWebsocketAsyncDelay", proxyws_set_aysnch_delay, NULL, RSRC_CONF|ACCESS_CONF, - "amount of time to poll before going asynchronous"), + "amount of time to poll before going asyncronous"), {NULL} }; diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 8e1e156d40..76ed0d4dd5 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -337,11 +337,12 @@ typedef struct typedef struct { - ap_mpm_callback_fn_t *cbfunc; - void *user_baton; - apr_array_header_t *pfds; - timer_event_t *cancel_event; /* If a timeout was requested, a pointer to the timer event */ - unsigned int signaled :1; + ap_mpm_callback_fn_t *cbfunc; + void *user_baton; + apr_pollfd_t **pfds; + int nsock; + timer_event_t *cancel_event; /* If a timeout was requested, a pointer to the timer event */ + unsigned int signaled:1; } socket_callback_baton_t; /* data retained by event across load/unload of the module @@ -590,9 +591,6 @@ static int event_query(int query_code, int *result, apr_status_t *rv) case AP_MPMQ_CAN_SUSPEND: *result = 1; break; - case AP_MPMQ_CAN_POLL: - *result = 1; - break; default: *rv = APR_ENOTIMPL; break; @@ -1482,7 +1480,7 @@ static timer_event_t * event_get_timer_event(apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton, int insert, - apr_array_header_t *remove) + apr_pollfd_t **remove) { timer_event_t *te; /* oh yeah, and make locking smarter/fine grained. */ @@ -1516,7 +1514,7 @@ static timer_event_t * event_get_timer_event(apr_time_t t, static apr_status_t event_register_timed_callback_ex(apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton, - apr_array_header_t *remove) + apr_pollfd_t **remove) { event_get_timer_event(t + apr_time_now(), cbfn, baton, 1, remove); return APR_SUCCESS; @@ -1530,79 +1528,95 @@ static apr_status_t event_register_timed_callback(apr_time_t t, return APR_SUCCESS; } -static apr_status_t event_cleanup_poll_callback(void *data) -{ - apr_status_t final_rc = APR_SUCCESS; - apr_array_header_t *pfds = data; - int i; - - for (i = 0; i < pfds->nelts; i++) { - apr_pollfd_t *pfd = (apr_pollfd_t *)pfds->elts + i; - if (pfd->client_data) { - apr_status_t rc; - rc = apr_pollset_remove(event_pollset, pfd); - if (rc != APR_SUCCESS && !APR_STATUS_IS_NOTFOUND(rc)) { - final_rc = rc; - } - } - } - - return final_rc; -} - -static apr_status_t event_register_poll_callback_ex(apr_array_header_t *pfds, +static apr_status_t event_register_socket_callback_ex(apr_socket_t **s, + apr_pool_t *p, + int for_read, ap_mpm_callback_fn_t *cbfn, ap_mpm_callback_fn_t *tofn, - void *baton, + void *baton, apr_time_t timeout) { - socket_callback_baton_t *scb = apr_pcalloc(pfds->pool, sizeof(*scb)); - listener_poll_type *pt = apr_palloc(pfds->pool, sizeof(*pt)); apr_status_t rc, final_rc= APR_SUCCESS; - int i; + int i = 0, nsock; + socket_callback_baton_t *scb = apr_pcalloc(p, sizeof(*scb)); + listener_poll_type *pt = apr_palloc(p, sizeof(*pt)); + apr_pollfd_t **pfds = NULL; + + while(s[i] != NULL) { + i++; + } + nsock = i; + + pfds = apr_pcalloc(p, (nsock+1) * sizeof(apr_pollfd_t*)); pt->type = PT_USER; pt->baton = scb; scb->cbfunc = cbfn; scb->user_baton = baton; + scb->nsock = nsock; scb->pfds = pfds; - apr_pool_pre_cleanup_register(pfds->pool, pfds, event_cleanup_poll_callback); - - for (i = 0; i < pfds->nelts; i++) { - apr_pollfd_t *pfd = (apr_pollfd_t *)pfds->elts + i; - pfd->reqevents = (pfd->reqevents) | APR_POLLERR | APR_POLLHUP; - pfd->client_data = pt; + for (i = 0; idesc_type = APR_POLL_SOCKET; + pfds[i]->reqevents = (for_read ? APR_POLLIN : APR_POLLOUT) | APR_POLLERR | APR_POLLHUP; + pfds[i]->desc.s = s[i]; + pfds[i]->p = p; + pfds[i]->client_data = pt; } if (timeout > 0) { /* XXX: This cancel timer event count fire before the pollset is updated */ scb->cancel_event = event_get_timer_event(timeout + apr_time_now(), tofn, baton, 1, pfds); } - for (i = 0; i < pfds->nelts; i++) { - apr_pollfd_t *pfd = (apr_pollfd_t *)pfds->elts + i; - rc = apr_pollset_add(event_pollset, pfd); + for (i = 0; ipool, pfds, event_cleanup_poll_callback); + int i = 0, nsock; + apr_status_t final_rc = APR_SUCCESS; + apr_pollfd_t **pfds = NULL; + + while(s[i] != NULL) { + i++; + } + nsock = i; + + pfds = apr_palloc(p, nsock * sizeof(apr_pollfd_t*)); + + for (i = 0; idesc_type = APR_POLL_SOCKET; + pfds[i]->reqevents = APR_POLLERR | APR_POLLHUP; + pfds[i]->desc.s = s[i]; + pfds[i]->client_data = NULL; + rc = apr_pollset_remove(event_pollset, pfds[i]); + if (rc != APR_SUCCESS && !APR_STATUS_IS_NOTFOUND(rc)) { + final_rc = rc; + } + } + + return final_rc; } /* @@ -1814,11 +1828,10 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) if (te->when < now + EVENT_FUDGE_FACTOR) { apr_skiplist_pop(timer_skiplist, NULL); if (!te->canceled) { - if (te->remove) { - int i; - for (i = 0; i < te->remove->nelts; i++) { - apr_pollfd_t *pfd = (apr_pollfd_t *)te->remove->elts + i; - apr_pollset_remove(event_pollset, pfd); + if (te->remove != NULL) { + apr_pollfd_t **pfds; + for (pfds = (te->remove); *pfds != NULL; pfds++) { + apr_pollset_remove(event_pollset, *pfds); } } push_timer2worker(te); @@ -2043,10 +2056,8 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) 0, /* don't insert it */ NULL /* no associated socket callback */); /* remove all sockets in my set */ - for (i = 0; i < baton->pfds->nelts; i++) { - apr_pollfd_t *pfd = (apr_pollfd_t *)baton->pfds->elts + i; - apr_pollset_remove(event_pollset, pfd); - pfd->client_data = NULL; + for (i = 0; i < baton->nsock; i++) { + apr_pollset_remove(event_pollset, baton->pfds[i]); } push_timer2worker(te); @@ -3778,11 +3789,11 @@ static void event_hooks(apr_pool_t * p) ap_hook_mpm_query(event_query, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_mpm_register_timed_callback(event_register_timed_callback, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_mpm_register_poll_callback(event_register_poll_callback, NULL, NULL, + ap_hook_mpm_register_socket_callback(event_register_socket_callback, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_mpm_register_poll_callback_timeout(event_register_poll_callback_ex, NULL, NULL, + ap_hook_mpm_register_socket_callback_timeout(event_register_socket_callback_ex, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_mpm_unregister_poll_callback(event_unregister_poll_callback, NULL, NULL, + ap_hook_mpm_unregister_socket_callback(event_unregister_socket_callback, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_pre_read_request(event_pre_read_request, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_read_request(event_post_read_request, NULL, NULL, APR_HOOK_MIDDLE); diff --git a/server/mpm/event/fdqueue.h b/server/mpm/event/fdqueue.h index 00059d3563..1e5a4e4c6c 100644 --- a/server/mpm/event/fdqueue.h +++ b/server/mpm/event/fdqueue.h @@ -64,14 +64,13 @@ typedef struct fd_queue_elem_t fd_queue_elem_t; typedef struct timer_event_t timer_event_t; -struct timer_event_t -{ +struct timer_event_t { APR_RING_ENTRY(timer_event_t) link; apr_time_t when; ap_mpm_callback_fn_t *cbfunc; void *baton; - int canceled; - apr_array_header_t *remove; + int canceled; + apr_pollfd_t **remove; }; struct fd_queue_t diff --git a/server/mpm_common.c b/server/mpm_common.c index ed003f74a5..3fdfcddb42 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -68,9 +68,9 @@ APR_HOOK_LINK(mpm) \ APR_HOOK_LINK(mpm_query) \ APR_HOOK_LINK(mpm_register_timed_callback) \ - APR_HOOK_LINK(mpm_register_poll_callback) \ - APR_HOOK_LINK(mpm_register_poll_callback_timeout) \ - APR_HOOK_LINK(mpm_unregister_poll_callback) \ + APR_HOOK_LINK(mpm_register_socket_callback) \ + APR_HOOK_LINK(mpm_register_socket_callback_timeout) \ + APR_HOOK_LINK(mpm_unregister_socket_callback) \ APR_HOOK_LINK(mpm_get_name) \ APR_HOOK_LINK(mpm_resume_suspended) \ APR_HOOK_LINK(end_generation) \ @@ -110,15 +110,15 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_timed_callback, AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_resume_suspended, (conn_rec *c), (c), APR_ENOTIMPL) -AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_poll_callback, - (apr_array_header_t *pds, ap_mpm_callback_fn_t *cbfn, void *baton), - (pds, cbfn, baton), APR_ENOTIMPL) -AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_poll_callback_timeout, - (apr_array_header_t *pds, ap_mpm_callback_fn_t *cbfn, ap_mpm_callback_fn_t *tofn, void *baton, apr_time_t timeout), - (pds, cbfn, tofn, baton, timeout), APR_ENOTIMPL) -AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_unregister_poll_callback, - (apr_array_header_t *pds), - (pds), APR_ENOTIMPL) +AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_socket_callback, + (apr_socket_t **s, apr_pool_t *p, int for_read, ap_mpm_callback_fn_t *cbfn, void *baton), + (s, p, for_read, cbfn, baton), APR_ENOTIMPL) +AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_socket_callback_timeout, + (apr_socket_t **s, apr_pool_t *p, int for_read, ap_mpm_callback_fn_t *cbfn, ap_mpm_callback_fn_t *tofn, void *baton, apr_time_t timeout), + (s, p, for_read, cbfn, tofn, baton, timeout), APR_ENOTIMPL) +AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_unregister_socket_callback, + (apr_socket_t **s, apr_pool_t *p), + (s, p), APR_ENOTIMPL) AP_IMPLEMENT_HOOK_RUN_FIRST(int, output_pending, (conn_rec *c), (c), DECLINED) AP_IMPLEMENT_HOOK_RUN_FIRST(int, input_pending, @@ -557,35 +557,31 @@ void ap_core_child_status(server_rec *s, pid_t pid, pid, gen, slot, status_msg); } -AP_DECLARE(apr_status_t) ap_mpm_resume_suspended(conn_rec *c) -{ +AP_DECLARE(apr_status_t) ap_mpm_resume_suspended(conn_rec *c) { return ap_run_mpm_resume_suspended(c); } -AP_DECLARE(apr_status_t) ap_mpm_register_timed_callback(apr_time_t t, - ap_mpm_callback_fn_t *cbfn, void *baton) +AP_DECLARE(apr_status_t) ap_mpm_register_timed_callback(apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton) { return ap_run_mpm_register_timed_callback(t, cbfn, baton); } - -AP_DECLARE(apr_status_t) ap_mpm_register_poll_callback(apr_array_header_t *pds, - ap_mpm_callback_fn_t *cbfn, void *baton) +AP_DECLARE(apr_status_t) ap_mpm_register_socket_callback(apr_socket_t **s, apr_pool_t *p, int for_read, ap_mpm_callback_fn_t *cbfn, void *baton) { - return ap_run_mpm_register_poll_callback(pds, cbfn, baton); + return ap_run_mpm_register_socket_callback(s, p, for_read, cbfn, baton); } - -AP_DECLARE(apr_status_t) ap_mpm_register_poll_callback_timeout( - apr_array_header_t *pds, ap_mpm_callback_fn_t *cbfn, - ap_mpm_callback_fn_t *tofn, void *baton, apr_time_t timeout) +AP_DECLARE(apr_status_t) ap_mpm_register_socket_callback_timeout(apr_socket_t **s, + apr_pool_t *p, + int for_read, + ap_mpm_callback_fn_t *cbfn, + ap_mpm_callback_fn_t *tofn, + void *baton, + apr_time_t timeout) { - return ap_run_mpm_register_poll_callback_timeout(pds, cbfn, tofn, baton, - timeout); + return ap_run_mpm_register_socket_callback_timeout(s, p, for_read, cbfn, tofn, baton, timeout); } - -AP_DECLARE(apr_status_t) ap_mpm_unregister_poll_callback( - apr_array_header_t *pds) +AP_DECLARE(apr_status_t) ap_mpm_unregister_socket_callback(apr_socket_t **s, apr_pool_t *p) { - return ap_run_mpm_unregister_poll_callback(pds); + return ap_run_mpm_unregister_socket_callback(s, p); } AP_DECLARE(const char *)ap_show_mpm(void)