]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
trunk: In reality halted can only be reached from a very small number of states,...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Mar 2020 14:39:05 +0000 (08:39 -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 b220727a120803781331b79059f6940471c254f3..523997f96fdc54708b076a7a9edc6d98fd61e781 100644 (file)
@@ -2824,31 +2824,15 @@ static void _trunk_connection_on_halted(UNUSED fr_connection_t *conn, UNUSED fr_
 {
        fr_trunk_connection_t   *tconn = talloc_get_type_abort(uctx, fr_trunk_connection_t);
        fr_trunk_t              *trunk = tconn->pub.trunk;
-       bool                    need_requeue = false;
 
        switch (tconn->pub.state) {
-       case FR_TRUNK_CONN_ACTIVE:
-       case FR_TRUNK_CONN_FULL:
-       case FR_TRUNK_CONN_INACTIVE:
-       case FR_TRUNK_CONN_INACTIVE_DRAINING:
-       case FR_TRUNK_CONN_DRAINING:
-       case FR_TRUNK_CONN_DRAINING_TO_FREE:
-               need_requeue = true;
-
-       /* FALL-THROUGH */
        case FR_TRUNK_CONN_INIT:
-       case FR_TRUNK_CONN_CONNECTING:
        case FR_TRUNK_CONN_CLOSED:
                trunk_connection_remove(tconn);
                break;
 
-       case FR_TRUNK_CONN_HALTED:      /* Nothing to do */
-               /*
-                *      Ensure the connection isn't in either list
-                */
-               rad_assert(!fr_dlist_entry_in_list(&tconn->entry));
-               rad_assert(tconn->heap_id == -1);
-               break;
+       default:
+               CONN_BAD_STATE_TRANSITION(FR_TRUNK_CONN_HALTED);
        }
 
        /*
@@ -2857,8 +2841,6 @@ static void _trunk_connection_on_halted(UNUSED fr_connection_t *conn, UNUSED fr_
         */
        CONN_STATE_TRANSITION(FR_TRUNK_CONN_HALTED);
 
-       if (need_requeue) trunk_connection_requests_requeue(tconn, FR_TRUNK_REQUEST_STATE_ALL, 0, true);
-
        /*
         *      There should be no requests left on this
         *      connection.  They should have all been