From: Nick Porter Date: Fri, 6 Sep 2024 12:29:13 +0000 (+0100) Subject: Allow connections to transition INIT -> CONNECTED X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf39f5698c9fcf71b6eedfbb3d93df737ef2684;p=thirdparty%2Ffreeradius-server.git Allow connections to transition INIT -> CONNECTED Required to use trunks / connecitons where connections are made synchronously, e.g. SQLite, or where connections return immediately --- diff --git a/src/lib/server/connection.c b/src/lib/server/connection.c index 5a960612be3..ff75f2261db 100644 --- a/src/lib/server/connection.c +++ b/src/lib/server/connection.c @@ -948,7 +948,7 @@ static void connection_state_enter_connected(connection_t *conn) { int ret; - fr_assert(conn->pub.state == CONNECTION_STATE_CONNECTING); + fr_assert(conn->pub.state == CONNECTION_STATE_CONNECTING || conn->pub.state == CONNECTION_STATE_INIT); STATE_TRANSITION(CONNECTION_STATE_CONNECTED); diff --git a/src/lib/server/trunk.c b/src/lib/server/trunk.c index dc0c7c5e2eb..f3fd3793c13 100644 --- a/src/lib/server/trunk.c +++ b/src/lib/server/trunk.c @@ -3243,6 +3243,7 @@ static void trunk_connection_enter_active(trunk_connection_t *tconn) trunk_connection_remove(tconn); break; + case TRUNK_CONN_INIT: case TRUNK_CONN_CONNECTING: trunk_connection_remove(tconn); fr_assert(trunk_request_count_by_connection(tconn, TRUNK_REQUEST_STATE_ALL) == 0);