From: Arran Cudbard-Bell Date: Tue, 18 Jul 2017 16:58:58 +0000 (-0400) Subject: Event list first to match the I/O callbacks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe9b80968b97948ede91bcbc3cf1cf9f1cf90c1c;p=thirdparty%2Ffreeradius-server.git Event list first to match the I/O callbacks --- diff --git a/src/include/connection.h b/src/include/connection.h index 25e5618f30b..e44ef781515 100644 --- a/src/include/connection.h +++ b/src/include/connection.h @@ -57,14 +57,14 @@ typedef fr_connection_state_t (*fr_connection_init_t)(int *fd_out, void *uctx); * This should be used to add any additional I/O events for the file descriptor * to call other code if it becomes readable or writable. * - * @param[in] fd That was successfully opened. * @param[in] el to use for inserting I/O events. + * @param[in] fd That was successfully opened. * @param[in] uctx User context. * @return * - #FR_CONNECTION_STATE_CONNECTED if the file descriptor is useable. * - #FR_CONNECTION_STATE_FAILED if the file descriptor is unusable. */ -typedef fr_connection_state_t (*fr_connection_open_t)(int fd, fr_event_list_t *el, void *uctx); +typedef fr_connection_state_t (*fr_connection_open_t)(fr_event_list_t *el, int fd, void *uctx); /** Notification that a connection attempt has failed * diff --git a/src/main/connection.c b/src/main/connection.c index ae4e8eea029..ec6aef2a3e8 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -235,7 +235,7 @@ static void _connection_writable(UNUSED fr_event_list_t *el, UNUSED int sock, UN fr_event_timer_delete(conn->el, &conn->connection_timer); fr_event_fd_delete(conn->el, conn->fd); - ret = conn->open(conn->fd, conn->el, conn->uctx); + ret = conn->open(conn->el, conn->fd, conn->uctx); switch (ret) { case FR_CONNECTION_STATE_CONNECTED: DEBUG2("Connection established"); diff --git a/src/modules/rlm_logtee/rlm_logtee.c b/src/modules/rlm_logtee/rlm_logtee.c index 446859faf77..6b96f89c42a 100644 --- a/src/modules/rlm_logtee/rlm_logtee.c +++ b/src/modules/rlm_logtee/rlm_logtee.c @@ -330,7 +330,7 @@ static void _logtee_conn_close(int fd, UNUSED void *uctx) /** Process notification that fd is open * */ -static fr_connection_state_t _logtee_conn_open(UNUSED int fd, UNUSED fr_event_list_t *el, void *uctx) +static fr_connection_state_t _logtee_conn_open(UNUSED fr_event_list_t *el, UNUSED int fd, void *uctx) { rlm_logtee_thread_t *t = talloc_get_type_abort(uctx, rlm_logtee_thread_t); diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index dbd9fed9f61..a19ed76b5b1 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -628,7 +628,7 @@ static void mod_conn_close(int fd, void *uctx) /** Process notification that fd is open * */ -static fr_connection_state_t mod_radius_conn_open(int fd, fr_event_list_t *el, void *uctx) +static fr_connection_state_t mod_radius_conn_open(fr_event_list_t *el, int fd, void *uctx) { rlm_radius_connection_t *c = talloc_get_type_abort(uctx, rlm_radius_connection_t); rlm_radius_thread_t *t = c->thread; @@ -638,7 +638,7 @@ static fr_connection_state_t mod_radius_conn_open(int fd, fr_event_list_t *el, v /* * Tell the underlying transport that it's now open. */ - state = inst->client_io->open(fd, el, c->client_io_ctx); + state = inst->client_io->open(el, fd, c->client_io_ctx); if (state != FR_CONNECTION_STATE_CONNECTED) { return state; } diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 7e9d9e79c5b..75b8d06cb8b 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -45,28 +45,28 @@ RCSID("$Id$") #include "rlm_radius.h" typedef struct rlm_radius_udp_t { - fr_ipaddr_t dst_ipaddr; //!< IP of the home server - fr_ipaddr_t src_ipaddr; //!< IP we open our socket on - uint16_t dst_port; //!< port of the home server - char const *secret; //!< shared secret + fr_ipaddr_t dst_ipaddr; //!< IP of the home server + fr_ipaddr_t src_ipaddr; //!< IP we open our socket on + uint16_t dst_port; //!< port of the home server + char const *secret; //!< shared secret - char const *interface; //!< Interface to bind to. + char const *interface; //!< Interface to bind to. - uint32_t recv_buff; //!< How big the kernel's receive buffer should be. - uint32_t send_buff; //!< How big the kernel's send buffer should be. + uint32_t recv_buff; //!< How big the kernel's receive buffer should be. + uint32_t send_buff; //!< How big the kernel's send buffer should be. - uint32_t max_packet_size; //!< maximum packet size + uint32_t max_packet_size; //!< maximum packet size - bool recv_buff_is_set; //!< Whether we were provided with a recv_buf - bool send_buff_is_set; //!< Whether we were provided with a send_buf + bool recv_buff_is_set; //!< Whether we were provided with a recv_buf + bool send_buff_is_set; //!< Whether we were provided with a send_buf - bool dst_ipaddr_is_set; //!< ipaddr config item is set. - bool dst_ipv4addr_is_set; //!< ipv4addr config item is set. - bool dst_ipv6addr_is_set; //!< ipv6addr config item is set. + bool dst_ipaddr_is_set; //!< ipaddr config item is set. + bool dst_ipv4addr_is_set; //!< ipv4addr config item is set. + bool dst_ipv6addr_is_set; //!< ipv6addr config item is set. - bool src_ipaddr_is_set; //!< src_ipaddr config item is set. - bool src_ipv4addr_is_set; //!< src_ipv4addr config item is set. - bool src_ipv6addr_is_set; //!< src_ipv6addr config item is set. + bool src_ipaddr_is_set; //!< src_ipaddr config item is set. + bool src_ipv4addr_is_set; //!< src_ipv4addr config item is set. + bool src_ipv6addr_is_set; //!< src_ipv6addr config item is set. } rlm_radius_udp_t; @@ -188,7 +188,7 @@ static void mod_close(int fd, void *io_ctx) /** Do more setup once the connection has been opened * */ -static fr_connection_state_t mod_open(UNUSED int fd, UNUSED fr_event_list_t *el, UNUSED void *io_ctx) +static fr_connection_state_t mod_open(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED void *io_ctx) { // udp_io_ctx_t_t *io = talloc_get_type_abort(io_ctx, udp_io_ctx_t);