summaryrefslogtreecommitdiffstats
path: root/server/mpm/event/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/mpm/event/event.c')
-rw-r--r--server/mpm/event/event.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index 2f5229aaa2..9979ee03e5 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -320,7 +320,7 @@ typedef struct
typedef struct
{
- ap_mpm_callback_fn_t *cbfunc;
+ ap_mpm_socket_callback_fn_t *cbfunc;
void *user_baton;
apr_pollfd_t **pfds;
int nsock;
@@ -1488,7 +1488,7 @@ static apr_status_t event_register_timed_callback(apr_time_t t,
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_socket_callback_fn_t *cbfn,
ap_mpm_callback_fn_t *tofn,
void *baton,
apr_time_t timeout)
@@ -1536,7 +1536,7 @@ static apr_status_t event_register_socket_callback_ex(apr_socket_t **s,
static apr_status_t event_register_socket_callback(apr_socket_t **s,
apr_pool_t *p,
int for_read,
- ap_mpm_callback_fn_t *cbfn,
+ ap_mpm_socket_callback_fn_t *cbfn,
void *baton)
{
return event_register_socket_callback_ex(s, p, for_read,
@@ -1657,6 +1657,12 @@ static void process_timeout_queue(struct timeout_queue *q,
apr_thread_mutex_lock(timeout_mutex);
}
+static void socket_callback_wrapper(void *baton){
+ const apr_pollfd_t *out_pfd = (const apr_pollfd_t *)baton;
+ socket_callback_baton_t *scb_baton = (socket_callback_baton_t *) ((listener_poll_type *) out_pfd->client_data)->baton;
+ scb_baton->cbfunc(scb_baton->user_baton, out_pfd);
+}
+
static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
{
timer_event_t *ep;
@@ -1974,8 +1980,8 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
if (!(baton->signaled)) {
baton->signaled = 1;
te = event_get_timer_event(-1 /* fake timer */,
- baton->cbfunc,
- baton->user_baton,
+ socket_callback_wrapper,
+ (apr_pollfd_t *)out_pfd,
0, /* don't insert it */
NULL /* no associated socket callback */);
/* remove other sockets in my set */