From: Alan T. DeKok Date: Sun, 31 Mar 2024 14:53:20 +0000 (-0400) Subject: add "ef_out" to fr_event_fd_insert() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27f2b68051550de01477fbc9d15273e764416ed4;p=thirdparty%2Ffreeradius-server.git add "ef_out" to fr_event_fd_insert() --- diff --git a/src/bin/radsniff.c b/src/bin/radsniff.c index b3826ae5426..fa4685a91cd 100644 --- a/src/bin/radsniff.c +++ b/src/bin/radsniff.c @@ -3055,7 +3055,7 @@ int main(int argc, char *argv[]) fr_exit_now(EXIT_FAILURE); } - if (fr_event_fd_insert(NULL, events, self_pipe[0], + if (fr_event_fd_insert(NULL, NULL, events, self_pipe[0], rs_signal_action, NULL, NULL, @@ -3102,7 +3102,7 @@ int main(int argc, char *argv[]) */ if (event->in->type == PCAP_FILE_IN) { rs_got_packet(events, in_p->fd, 0, event); - } else if (fr_event_fd_insert(NULL, events, in_p->fd, + } else if (fr_event_fd_insert(NULL, NULL, events, in_p->fd, rs_got_packet, NULL, NULL, diff --git a/src/lib/curl/io.c b/src/lib/curl/io.c index b1cba5fa686..64e2a30adc4 100644 --- a/src/lib/curl/io.c +++ b/src/lib/curl/io.c @@ -319,7 +319,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha switch (what) { case CURL_POLL_IN: - if (fr_event_fd_insert(mhandle, mhandle->el, fd, + if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd, _fr_curl_io_service_readable, NULL, _fr_curl_io_service_errored, @@ -332,7 +332,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha break; case CURL_POLL_OUT: - if (fr_event_fd_insert(mhandle, mhandle->el, fd, + if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd, NULL, _fr_curl_io_service_writable, _fr_curl_io_service_errored, @@ -345,7 +345,7 @@ static int _fr_curl_io_event_modify(UNUSED CURL *easy, curl_socket_t fd, int wha break; case CURL_POLL_INOUT: - if (fr_event_fd_insert(mhandle, mhandle->el, fd, + if (fr_event_fd_insert(mhandle, NULL, mhandle->el, fd, _fr_curl_io_service_readable, _fr_curl_io_service_writable, _fr_curl_io_service_errored, diff --git a/src/lib/io/control.c b/src/lib/io/control.c index 3e0137af38e..5f3de7e110f 100644 --- a/src/lib/io/control.c +++ b/src/lib/io/control.c @@ -171,7 +171,7 @@ fr_control_t *fr_control_create(TALLOC_CTX *ctx, fr_event_list_t *el, fr_atomic_ (void) fcntl(c->pipe[0], F_SETFL, O_NONBLOCK | FD_CLOEXEC); (void) fcntl(c->pipe[1], F_SETFL, O_NONBLOCK | FD_CLOEXEC); - if (fr_event_fd_insert(c, el, c->pipe[0], pipe_read, NULL, NULL, c) < 0) { + if (fr_event_fd_insert(c, NULL, el, c->pipe[0], pipe_read, NULL, NULL, c) < 0) { talloc_free(c); fr_strerror_const_push("Failed adding FD to event list control socket"); return NULL; diff --git a/src/lib/io/network.c b/src/lib/io/network.c index 3cfc9e28889..8d77c0efb30 100644 --- a/src/lib/io/network.c +++ b/src/lib/io/network.c @@ -1371,7 +1371,7 @@ static int fr_network_listen_add_self(fr_network_t *nr, fr_listen_t *listen) app_io = s->listen->app_io; s->filter = FR_EVENT_FILTER_IO; - if (fr_event_fd_insert(nr, nr->el, s->listen->fd, + if (fr_event_fd_insert(nr, NULL, nr->el, s->listen->fd, fr_network_read, s->listen->no_write_callback ? NULL : fr_network_write, fr_network_error, @@ -1979,7 +1979,7 @@ fr_network_t *fr_network_create(TALLOC_CTX *ctx, fr_event_list_t *el, char const if (fr_nonblock(nr->signal_pipe[0]) < 0) goto fail2; if (fr_nonblock(nr->signal_pipe[1]) < 0) goto fail2; - if (fr_event_fd_insert(nr, nr->el, nr->signal_pipe[0], _signal_pipe_read, NULL, NULL, nr) < 0) { + if (fr_event_fd_insert(nr, NULL, nr->el, nr->signal_pipe[0], _signal_pipe_read, NULL, NULL, nr) < 0) { fr_strerror_const("Failed inserting event for signal pipe"); goto fail2; } diff --git a/src/lib/ldap/bind.c b/src/lib/ldap/bind.c index 03fd81bd495..ee3de78a043 100644 --- a/src/lib/ldap/bind.c +++ b/src/lib/ldap/bind.c @@ -141,7 +141,7 @@ static void _ldap_bind_io_write(fr_event_list_t *el, int fd, UNUSED int flags, v return; } - ret = fr_event_fd_insert(bind_ctx, el, fd, + ret = fr_event_fd_insert(bind_ctx, NULL, el, fd, NULL, _ldap_bind_io_write, /* We'll be called again when the conn is open */ _ldap_bind_io_error, @@ -155,7 +155,7 @@ static void _ldap_bind_io_write(fr_event_list_t *el, int fd, UNUSED int flags, v if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error; } c->fd = fd; - ret = fr_event_fd_insert(bind_ctx, el, fd, + ret = fr_event_fd_insert(bind_ctx, NULL, el, fd, _ldap_bind_io_read, NULL, _ldap_bind_io_error, @@ -212,7 +212,7 @@ int fr_ldap_bind_async(fr_ldap_connection_t *c, if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)) { int ret; - ret = fr_event_fd_insert(bind_ctx, el, fd, + ret = fr_event_fd_insert(bind_ctx, NULL, el, fd, NULL, _ldap_bind_io_write, _ldap_bind_io_error, diff --git a/src/lib/ldap/connection.c b/src/lib/ldap/connection.c index 13c6aad66de..a64332c312e 100644 --- a/src/lib/ldap/connection.c +++ b/src/lib/ldap/connection.c @@ -610,7 +610,7 @@ static void ldap_trunk_connection_notify(fr_trunk_connection_t *tconn, fr_connec break; } - if (fr_event_fd_insert(ldap_conn, el, ldap_conn->fd, + if (fr_event_fd_insert(ldap_conn, NULL, el, ldap_conn->fd, read_fn, write_fn, ldap_conn_error, diff --git a/src/lib/ldap/sasl.c b/src/lib/ldap/sasl.c index 1ae0ed9f7aa..9e47a36b483 100644 --- a/src/lib/ldap/sasl.c +++ b/src/lib/ldap/sasl.c @@ -175,7 +175,7 @@ static void _ldap_sasl_bind_io_read(fr_event_list_t *el, int fd, UNUSED int flag */ if (sasl_ctx->rmech) DEBUG3("Continuing SASL mech %s...", sasl_ctx->rmech); - ret = fr_event_fd_insert(sasl_ctx, el, fd, + ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd, NULL, _ldap_sasl_bind_io_write, /* Need to write more SASL stuff */ _ldap_sasl_bind_io_error, @@ -238,7 +238,7 @@ static void _ldap_sasl_bind_io_write(fr_event_list_t *el, int fd, UNUSED int fla return; } - ret = fr_event_fd_insert(sasl_ctx, el, fd, + ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd, NULL, _ldap_sasl_bind_io_write, /* We'll be called again when the conn is open */ _ldap_sasl_bind_io_error, @@ -255,7 +255,7 @@ static void _ldap_sasl_bind_io_write(fr_event_list_t *el, int fd, UNUSED int fla if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error; } c->fd = fd; - ret = fr_event_fd_insert(sasl_ctx, el, fd, + ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd, _ldap_sasl_bind_io_read, NULL, _ldap_sasl_bind_io_error, @@ -340,7 +340,7 @@ int fr_ldap_sasl_bind_async(fr_ldap_connection_t *c, if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)){ int ret; - ret = fr_event_fd_insert(sasl_ctx, el, fd, + ret = fr_event_fd_insert(sasl_ctx, NULL, el, fd, NULL, _ldap_sasl_bind_io_write, _ldap_sasl_bind_io_error, diff --git a/src/lib/ldap/start_tls.c b/src/lib/ldap/start_tls.c index 76fd4578370..527ba041343 100644 --- a/src/lib/ldap/start_tls.c +++ b/src/lib/ldap/start_tls.c @@ -179,7 +179,7 @@ static void _ldap_start_tls_io_write(fr_event_list_t *el, int fd, UNUSED int fla return; } - ret = fr_event_fd_insert(tls_ctx, el, fd, + ret = fr_event_fd_insert(tls_ctx, NULL, el, fd, NULL, _ldap_start_tls_io_write, /* We'll be called again when the conn is open */ _ldap_start_tls_io_error, @@ -193,7 +193,7 @@ static void _ldap_start_tls_io_write(fr_event_list_t *el, int fd, UNUSED int fla if ((ret != LDAP_OPT_SUCCESS) || (fd < 0)) goto error; } c->fd = fd; - ret = fr_event_fd_insert(tls_ctx, el, fd, + ret = fr_event_fd_insert(tls_ctx, NULL, el, fd, _ldap_start_tls_io_read, NULL, _ldap_start_tls_io_error, @@ -241,7 +241,7 @@ int fr_ldap_start_tls_async(fr_ldap_connection_t *c, LDAPControl **serverctrls, if ((ldap_get_option(c->handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)) { int ret; - ret = fr_event_fd_insert(tls_ctx, el, fd, + ret = fr_event_fd_insert(tls_ctx, NULL, el, fd, NULL, _ldap_start_tls_io_write, _ldap_start_tls_io_error, diff --git a/src/lib/redis/io.c b/src/lib/redis/io.c index 4ba1b7801a4..8cebe08fc00 100644 --- a/src/lib/redis/io.c +++ b/src/lib/redis/io.c @@ -135,7 +135,7 @@ static void _redis_io_common(fr_connection_t *conn, fr_redis_handle_t *h, bool r DEBUG4("redis handle %p - Registered for %s%serror events on FD %i", h, read ? "read+" : "", write ? "write+" : "", c->fd); - if (fr_event_fd_insert(h, el, c->fd, + if (fr_event_fd_insert(h, NULL, el, c->fd, read ? _redis_io_service_readable : NULL, write ? _redis_io_service_writable : NULL, _redis_io_service_errored, diff --git a/src/lib/server/connection.c b/src/lib/server/connection.c index 089d7ee1999..bb0103faab7 100644 --- a/src/lib/server/connection.c +++ b/src/lib/server/connection.c @@ -1405,7 +1405,7 @@ int fr_connection_signal_on_fd(fr_connection_t *conn, int fd) * If connection becomes writable we * assume it's open. */ - if (fr_event_fd_insert(conn, conn->pub.el, fd, + if (fr_event_fd_insert(conn, NULL, conn->pub.el, fd, NULL, _connection_writable, _connection_error, diff --git a/src/lib/server/exec.c b/src/lib/server/exec.c index d9507b3da46..c32377b47d4 100644 --- a/src/lib/server/exec.c +++ b/src/lib/server/exec.c @@ -1059,7 +1059,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request, * Accept a maximum of 32k of data from the process. */ fr_sbuff_init_talloc(exec->stdout_ctx, &exec->stdout_buff, &exec->stdout_tctx, 128, 32 * 1024); - if (fr_event_fd_insert(ctx, el, exec->stdout_fd, exec_stdout_read, NULL, NULL, exec) < 0) { + if (fr_event_fd_insert(ctx, NULL, el, exec->stdout_fd, exec_stdout_read, NULL, NULL, exec) < 0) { RPEDEBUG("Failed adding event listening to stdout"); goto fail_and_close; } @@ -1077,7 +1077,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request, .prefix = exec->stdout_prefix }; - if (fr_event_fd_insert(ctx, el, exec->stdout_fd, log_request_fd_event, + if (fr_event_fd_insert(ctx, NULL, el, exec->stdout_fd, log_request_fd_event, NULL, NULL, &exec->stdout_uctx) < 0){ RPEDEBUG("Failed adding event listening to stdout"); goto fail_and_close; @@ -1095,7 +1095,7 @@ int fr_exec_oneshot(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *request, .prefix = exec->stderr_prefix }; - if (fr_event_fd_insert(ctx, el, exec->stderr_fd, log_request_fd_event, + if (fr_event_fd_insert(ctx, NULL, el, exec->stderr_fd, log_request_fd_event, NULL, NULL, &exec->stderr_uctx) < 0) { RPEDEBUG("Failed adding event listening to stderr"); close(exec->stderr_fd); diff --git a/src/lib/server/main_loop.c b/src/lib/server/main_loop.c index f7637db6239..6e889f26d14 100644 --- a/src/lib/server/main_loop.c +++ b/src/lib/server/main_loop.c @@ -278,7 +278,7 @@ int main_loop_init(void) } DEBUG4("Created self-signal pipe. Read end FD %i, write end FD %i", self_pipe[0], self_pipe[1]); - if (fr_event_fd_insert(NULL, event_list, self_pipe[0], + if (fr_event_fd_insert(NULL, NULL, event_list, self_pipe[0], main_loop_signal_recv, NULL, NULL, diff --git a/src/lib/server/trunk_tests.c b/src/lib/server/trunk_tests.c index c76f6d2cf25..623819c1d24 100644 --- a/src/lib/server/trunk_tests.c +++ b/src/lib/server/trunk_tests.c @@ -181,15 +181,15 @@ static void _conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *conn, break; case FR_TRUNK_CONN_EVENT_READ: - TEST_CHECK(fr_event_fd_insert(conn, el, fd, _conn_io_read, NULL, _conn_io_error, tconn) == 0); + TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, _conn_io_read, NULL, _conn_io_error, tconn) == 0); break; case FR_TRUNK_CONN_EVENT_WRITE: - TEST_CHECK(fr_event_fd_insert(conn, el, fd, NULL, _conn_io_write, _conn_io_error, tconn) == 0); + TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, NULL, _conn_io_write, _conn_io_error, tconn) == 0); break; case FR_TRUNK_CONN_EVENT_BOTH: - TEST_CHECK(fr_event_fd_insert(conn, el, fd, _conn_io_read, _conn_io_write, _conn_io_error, tconn) == 0); + TEST_CHECK(fr_event_fd_insert(conn, NULL, el, fd, _conn_io_read, _conn_io_write, _conn_io_error, tconn) == 0); break; default: @@ -302,7 +302,7 @@ static fr_connection_state_t _conn_open(fr_event_list_t *el, void *h, UNUSED voi /* * This always needs to be inserted */ - TEST_CHECK(fr_event_fd_insert(our_h, el, our_h[1], _conn_io_loopback, NULL, NULL, our_h) == 0); + TEST_CHECK(fr_event_fd_insert(our_h, NULL, el, our_h[1], _conn_io_loopback, NULL, NULL, our_h) == 0); return FR_CONNECTION_STATE_CONNECTED; } diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index fc81efb8025..6038a24dcdb 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -276,7 +276,7 @@ int unlang_module_fd_add(request_t *request, /* * Register for events on the file descriptor */ - if (fr_event_fd_insert(request, unlang_interpret_event_list(request), fd, + if (fr_event_fd_insert(request, NULL, unlang_interpret_event_list(request), fd, ev->fd_read ? unlang_event_fd_read_handler : NULL, ev->fd_write ? unlang_event_fd_write_handler : NULL, ev->fd_error ? unlang_event_fd_error_handler: NULL, diff --git a/src/lib/util/event.c b/src/lib/util/event.c index 6f5d9342665..085eba31195 100644 --- a/src/lib/util/event.c +++ b/src/lib/util/event.c @@ -1212,6 +1212,7 @@ int _fr_event_filter_insert(NDEBUG_LOCATION_ARGS /** Associate I/O callbacks with a file descriptor * * @param[in] ctx to bind lifetime of the event to. + * @param[out] ef_out Where to store the output event * @param[in] el to insert fd callback into. * @param[in] fd to install filters for. * @param[in] read_fn function to call when fd is readable. @@ -1223,7 +1224,7 @@ int _fr_event_filter_insert(NDEBUG_LOCATION_ARGS * - -1 on failure. */ int _fr_event_fd_insert(NDEBUG_LOCATION_ARGS - TALLOC_CTX *ctx, fr_event_list_t *el, int fd, + TALLOC_CTX *ctx, fr_event_fd_t **ef_out, fr_event_list_t *el, int fd, fr_event_fd_cb_t read_fn, fr_event_fd_cb_t write_fn, fr_event_error_cb_t error, @@ -1237,7 +1238,7 @@ int _fr_event_fd_insert(NDEBUG_LOCATION_ARGS } return _fr_event_filter_insert(NDEBUG_LOCATION_VALS - ctx, NULL, el, fd, FR_EVENT_FILTER_IO, &funcs, error, uctx); + ctx, ef_out, el, fd, FR_EVENT_FILTER_IO, &funcs, error, uctx); } /** Remove a file descriptor from the event loop diff --git a/src/lib/util/event.h b/src/lib/util/event.h index 94a5d24e19d..d3c470a5e7c 100644 --- a/src/lib/util/event.h +++ b/src/lib/util/event.h @@ -224,7 +224,7 @@ int _fr_event_filter_update(NDEBUG_LOCATION_ARGS #define fr_event_filter_update(...) _fr_event_filter_update(NDEBUG_LOCATION_EXP __VA_ARGS__) int _fr_event_fd_insert(NDEBUG_LOCATION_ARGS - TALLOC_CTX *ctx, fr_event_list_t *el, int fd, + TALLOC_CTX *ctx, fr_event_fd_t **ef_out, fr_event_list_t *el, int fd, fr_event_fd_cb_t read_fn, fr_event_fd_cb_t write_fn, fr_event_error_cb_t error, diff --git a/src/lib/util/log.c b/src/lib/util/log.c index 32dfa25fa4a..7d2c2332cd9 100644 --- a/src/lib/util/log.c +++ b/src/lib/util/log.c @@ -1283,7 +1283,7 @@ int fr_log_global_init(fr_event_list_t *el, bool daemonize) /* * Now do stderr... */ - if (unlikely(fr_event_fd_insert(NULL, el, stdout_pipe[1], fr_log_fd_event, NULL, NULL, &stdout_ctx) < 0)) { + if (unlikely(fr_event_fd_insert(NULL, NULL, el, stdout_pipe[1], fr_log_fd_event, NULL, NULL, &stdout_ctx) < 0)) { fr_strerror_const_push("Failed adding stdout handler to event loop"); error_2: dup2(STDOUT_FILENO, stdout_fd); /* Copy back the stdout FD */ @@ -1321,7 +1321,7 @@ int fr_log_global_init(fr_event_list_t *el, bool daemonize) stdout_ctx.type = L_ERR; stdout_ctx.lvl = L_DBG_LVL_OFF; /* Log at all debug levels */ - if (unlikely(fr_event_fd_insert(NULL, el, stderr_pipe[1], fr_log_fd_event, NULL, NULL, &stderr_ctx) < 0)) { + if (unlikely(fr_event_fd_insert(NULL, NULL, el, stderr_pipe[1], fr_log_fd_event, NULL, NULL, &stderr_ctx) < 0)) { fr_strerror_const_push("Failed adding stdout handler to event loop"); error_6: dup2(STDERR_FILENO, stderr_fd); /* Copy back the stderr FD */ diff --git a/src/lib/util/udp_queue.c b/src/lib/util/udp_queue.c index 7ab8736076e..2c31f0cda12 100644 --- a/src/lib/util/udp_queue.c +++ b/src/lib/util/udp_queue.c @@ -291,7 +291,7 @@ retry: /* */ - if (fr_event_fd_insert(uq, uq->el, uq->fd, NULL, + if (fr_event_fd_insert(uq, NULL, uq->el, uq->fd, NULL, udp_queue_writable, NULL, uq) < 0) { return -1; } diff --git a/src/listen/ldap_sync/proto_ldap_sync_ldap.c b/src/listen/ldap_sync/proto_ldap_sync_ldap.c index 6d66048d40b..38f2d8280a2 100644 --- a/src/listen/ldap_sync/proto_ldap_sync_ldap.c +++ b/src/listen/ldap_sync/proto_ldap_sync_ldap.c @@ -1223,7 +1223,7 @@ static void _proto_ldap_socket_open_connected(fr_connection_t *conn, UNUSED fr_c /* * Set the callback which will handle the results of this query */ - if (fr_event_fd_insert(conn, conn->el, ldap_conn->fd, + if (fr_event_fd_insert(conn, NULL, conn->el, ldap_conn->fd, _proto_ldap_socket_open_read, NULL, _proto_ldap_socket_open_error, diff --git a/src/modules/rlm_icmp/rlm_icmp.c b/src/modules/rlm_icmp/rlm_icmp.c index 583461ae019..393b9b071b9 100644 --- a/src/modules/rlm_icmp/rlm_icmp.c +++ b/src/modules/rlm_icmp/rlm_icmp.c @@ -477,7 +477,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx) * We assume that the outbound socket is always writable. * If not, too bad. Packets will get lost. */ - if (fr_event_fd_insert(t, mctx->el, fd, + if (fr_event_fd_insert(t, NULL, mctx->el, fd, mod_icmp_read, NULL, mod_icmp_error, diff --git a/src/modules/rlm_logtee/rlm_logtee.c b/src/modules/rlm_logtee/rlm_logtee.c index 4bc77456d81..1c373916d2d 100644 --- a/src/modules/rlm_logtee/rlm_logtee.c +++ b/src/modules/rlm_logtee/rlm_logtee.c @@ -319,7 +319,7 @@ static void logtee_fd_idle(rlm_logtee_thread_t *t) int fd = *((int *)t->conn->h); DEBUG3("Marking socket (%i) as idle", fd); - if (fr_event_fd_insert(t->conn, t->el, fd, + if (fr_event_fd_insert(t->conn, NULL, t->el, fd, _logtee_conn_read, NULL, _logtee_conn_error, @@ -339,7 +339,7 @@ static void logtee_fd_active(rlm_logtee_thread_t *t) int fd = *((int *)t->conn->h); DEBUG3("Marking socket (%i) as active - Draining requests", fd); - if (fr_event_fd_insert(t->conn, t->el, fd, + if (fr_event_fd_insert(t->conn, NULL, t->el, fd, _logtee_conn_read, _logtee_conn_writable, _logtee_conn_error, diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 033ea277386..8fe72068145 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -484,7 +484,7 @@ static void conn_status_check_timeout(fr_event_list_t *el, fr_time_t now, void * return; case FR_RETRY_CONTINUE: - if (fr_event_fd_insert(h, el, h->fd, conn_writable_status_check, NULL, + if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) { PERROR("%s - Failed inserting FD event", h->module_name); fr_connection_signal_reconnect(conn, FR_CONNECTION_FAILED); @@ -503,7 +503,7 @@ static void conn_status_check_again(fr_event_list_t *el, UNUSED fr_time_t now, v fr_connection_t *conn = talloc_get_type_abort(uctx, fr_connection_t); udp_handle_t *h = talloc_get_type_abort(conn->h, udp_handle_t); - if (fr_event_fd_insert(h, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) { + if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) { PERROR("%s - Failed inserting FD event", h->module_name); fr_connection_signal_reconnect(conn, FR_CONNECTION_FAILED); } @@ -660,7 +660,7 @@ static void conn_writable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE * Switch to waiting on read and insert the event * for the response timeout. */ - if (fr_event_fd_insert(h, conn->el, h->fd, conn_readable_status_check, NULL, conn_error_status_check, conn) < 0) { + if (fr_event_fd_insert(h, NULL, conn->el, h->fd, conn_readable_status_check, NULL, conn_error_status_check, conn) < 0) { PERROR("%s - Failed inserting FD event", h->module_name); goto fail; } @@ -845,7 +845,7 @@ static fr_connection_state_t conn_init(void **h_out, fr_connection_t *conn, void * one response to bring the connection online, * otherwise we need inst->num_answers_to_alive */ - if (fr_event_fd_insert(h, conn->el, h->fd, NULL, + if (fr_event_fd_insert(h, NULL, conn->el, h->fd, NULL, conn_writable_status_check, conn_error_status_check, conn) < 0) goto fail; /* * If we're not doing status-checks, signal the connection @@ -1028,7 +1028,7 @@ static void thread_conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *co } - if (fr_event_fd_insert(h, el, h->fd, + if (fr_event_fd_insert(h, NULL, el, h->fd, read_fn, write_fn, conn_error, @@ -1070,7 +1070,7 @@ static void thread_conn_notify_replicate(fr_trunk_connection_t *tconn, fr_connec break; } - if (fr_event_fd_insert(h, el, h->fd, + if (fr_event_fd_insert(h, NULL, el, h->fd, read_fn, write_fn, conn_error, diff --git a/src/modules/rlm_sigtran/client.c b/src/modules/rlm_sigtran/client.c index 1699159238e..a3b2e80bb4b 100644 --- a/src/modules/rlm_sigtran/client.c +++ b/src/modules/rlm_sigtran/client.c @@ -177,7 +177,7 @@ int sigtran_client_thread_register(fr_event_list_t *el) * and resume requests which are * waiting. */ - if (fr_event_fd_insert(NULL, el, req_pipe[0], _sigtran_pipe_read, NULL, _sigtran_pipe_error, NULL) < 0) { + if (fr_event_fd_insert(NULL, NULL, el, req_pipe[0], _sigtran_pipe_read, NULL, _sigtran_pipe_error, NULL) < 0) { ERROR("worker - Failed listening on osmocom pipe"); goto error; } diff --git a/src/modules/rlm_tacacs/rlm_tacacs_tcp.c b/src/modules/rlm_tacacs/rlm_tacacs_tcp.c index 353bbfa2935..2bb33c83017 100644 --- a/src/modules/rlm_tacacs/rlm_tacacs_tcp.c +++ b/src/modules/rlm_tacacs/rlm_tacacs_tcp.c @@ -489,7 +489,7 @@ static void thread_conn_notify(fr_trunk_connection_t *tconn, fr_connection_t *co } - if (fr_event_fd_insert(h, el, h->fd, + if (fr_event_fd_insert(h, NULL, el, h->fd, read_fn, write_fn, conn_error, diff --git a/src/modules/rlm_unbound/io.c b/src/modules/rlm_unbound/io.c index 415ff3b29be..6467943ea8a 100644 --- a/src/modules/rlm_unbound/io.c +++ b/src/modules/rlm_unbound/io.c @@ -257,7 +257,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv DEBUG4("unbound event %p - Registered for read+write events on FD %i", ev, ev->fd); - if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd, + if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd, _unbound_io_service_readable, _unbound_io_service_writable, _unbound_io_service_errored, @@ -272,7 +272,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv DEBUG4("unbound event %p - Registered for read+error events on FD %i", ev, ev->fd); - if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd, + if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd, _unbound_io_service_readable, NULL, _unbound_io_service_errored, @@ -287,7 +287,7 @@ static int _unbound_io_event_activate(struct ub_event *ub_ev, struct timeval *tv DEBUG4("unbound event %p - Registered for write+error events on FD %i", ev, ev->fd); - if (fr_event_fd_insert(ev, ev->ev_b->el, ev->fd, + if (fr_event_fd_insert(ev, NULL, ev->ev_b->el, ev->fd, NULL, _unbound_io_service_writable, _unbound_io_service_errored,