From: Arran Cudbard-Bell Date: Tue, 7 Apr 2020 00:52:52 +0000 (-0500) Subject: trunk: Better assert for unexpected post cancellation state X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=952403dec608f37a910ceb4fd1ae70144bc18e7a;p=thirdparty%2Ffreeradius-server.git trunk: Better assert for unexpected post cancellation state --- diff --git a/src/lib/server/trunk.c b/src/lib/server/trunk.c index 6a579cd0b17..7799c14c1e9 100644 --- a/src/lib/server/trunk.c +++ b/src/lib/server/trunk.c @@ -1645,27 +1645,21 @@ void fr_trunk_request_signal_cancel(fr_trunk_request_t *treq) case FR_TRUNK_REQUEST_STATE_SENT: trunk_request_enter_cancel(treq, FR_TRUNK_CANCEL_REASON_SIGNAL); - switch (treq->pub.state) { - case FR_TRUNK_REQUEST_STATE_CANCEL: - /* - * No cancel muxer. We're done. - * - * If we do have a cancel mux function, - * the next time this connection becomes - * writable, we'll call the cancel mux - * function. - */ - if (!trunk->funcs.request_cancel_mux) { - trunk_request_enter_unassigned(treq); - fr_trunk_request_free(&treq); - } - break; + if (!fr_cond_assert_msg(treq->pub.state == FR_TRUNK_REQUEST_STATE_CANCEL, + "Bad state %s after cancellation", + fr_table_str_by_value(fr_trunk_request_states, treq->pub.state, ""))); /* - * Shouldn't be in any other state after this + * No cancel muxer. We're done. + * + * If we do have a cancel mux function, + * the next time this connection becomes + * writable, we'll call the cancel mux + * function. */ - default: - rad_assert(0); + if (!trunk->funcs.request_cancel_mux) { + trunk_request_enter_unassigned(treq); + fr_trunk_request_free(&treq); } break;