]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow connections to transition INIT -> CONNECTED
authorNick Porter <nick@portercomputing.co.uk>
Fri, 6 Sep 2024 12:29:13 +0000 (13:29 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 12 Sep 2024 09:21:50 +0000 (10:21 +0100)
Required to use trunks / connecitons where connections are made
synchronously, e.g. SQLite, or where connections return
immediately

src/lib/server/connection.c
src/lib/server/trunk.c

index 5a960612be3d58c773127c6562d4c35c79eff4ab..ff75f2261dbfcca1364bd7deed30ac79b5fc070c 100644 (file)
@@ -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);
 
index dc0c7c5e2eb8948e8e39b581e9beaac54740759c..f3fd3793c13363c0b92cd4e313ccc210a9c1bb28 100644 (file)
@@ -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);