]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Call the cancel callback after the request has changed state
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 6 Dec 2019 11:45:31 +0000 (18:45 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 7 Dec 2019 05:36:35 +0000 (12:36 +0700)
src/lib/server/trunk.c

index 8a100c723d0ded98357417d66e9c9401f7e6bd0b..4d9c588e53d5cce8065dbdc56af9075a68123bb2 100644 (file)
@@ -887,12 +887,10 @@ static void trunk_request_enter_cancel(fr_trunk_request_t *treq, fr_trunk_cancel
        switch (treq->state) {
        case FR_TRUNK_REQUEST_PARTIAL:
                REQUEST_EXTRACT_PARTIAL(treq);
-               DO_REQUEST_CANCEL(treq, reason);
                break;
 
        case FR_TRUNK_REQUEST_SENT:
                fr_dlist_remove(&tconn->sent, treq);
-               DO_REQUEST_CANCEL(treq, reason);
                break;
 
        default:
@@ -903,6 +901,8 @@ static void trunk_request_enter_cancel(fr_trunk_request_t *treq, fr_trunk_cancel
        fr_dlist_insert_tail(&tconn->cancel, treq);
        treq->cancel_reason = reason;
 
+       DO_REQUEST_CANCEL(treq, reason);
+
        /*
         *      Our treq is no longer bound to an actual
         *      REQUEST *, as we can't guarantee the