]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle cancelling SQL requests that are already reapable
authorNick Porter <nick@portercomputing.co.uk>
Thu, 9 Oct 2025 14:17:48 +0000 (15:17 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 9 Oct 2025 14:19:17 +0000 (15:19 +0100)
These are really complete, and don't need to go round the query
cancellation path.

src/modules/rlm_sql/sql.c

index 6c340b947535853acbbb40c90be7f1325e593724..9e893333697a4deca1f16dde0028a4d6caec3d5c 100644 (file)
@@ -212,6 +212,15 @@ static void sql_trunk_query_cancel(UNUSED request_t *request, UNUSED fr_signal_t
 
        if (!query_ctx->treq) return;
 
+       /*
+        *      A reapable trunk request has already completed.
+        */
+       if (unlikely(query_ctx->treq->state == TRUNK_REQUEST_STATE_REAPABLE)) {
+               trunk_request_signal_complete(query_ctx->treq);
+               query_ctx->treq = NULL;
+               return;
+       }
+
        /*
         *      The query_ctx needs to be parented by the treq so that it still exists
         *      when the cancel_mux callback is run.