]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
trunk: Signalling an inactive-draining connection to be active, should move it to...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Mar 2020 14:37:59 +0000 (08:37 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Mar 2020 16:07:03 +0000 (10:07 -0600)
src/lib/server/trunk.c

index b510e4980a0b5b041fcd42a16915368fd569f3d7..7a07b332102d87e3303861f790dad1d34c4d4459 100644 (file)
@@ -2400,6 +2400,7 @@ static void trunk_connection_enter_inactive_draining(fr_trunk_connection_t *tcon
 
        switch (tconn->pub.state) {
        case FR_TRUNK_CONN_INACTIVE:
+       case FR_TRUNK_CONN_DRAINING:
                trunk_connection_remove(tconn);
                break;
 
@@ -3146,7 +3147,6 @@ void fr_trunk_connection_signal_active(fr_trunk_connection_t *tconn)
                break;
 
        case FR_TRUNK_CONN_INACTIVE:
-       case FR_TRUNK_CONN_INACTIVE_DRAINING:           /* Only an external signal can trigger this transition */
                /*
                 *      Do the appropriate state transition based on
                 *      how many requests the trunk connection is
@@ -3159,6 +3159,15 @@ void fr_trunk_connection_signal_active(fr_trunk_connection_t *tconn)
                trunk_connection_enter_active(tconn);
                break;
 
+       /*
+        *      Unsetting the active flag just moves
+        *      the connection back to the normal
+        *      draining state.
+        */
+       case FR_TRUNK_CONN_INACTIVE_DRAINING:           /* Only an external signal can trigger this transition */
+               trunk_connection_enter_draining(tconn);
+               break;
+
        default:
                return;
        }