]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
distinguish frame_signal and interpret_signal
authorAlan T. DeKok <aland@freeradius.org>
Fri, 18 Apr 2025 17:23:51 +0000 (13:23 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 18 Apr 2025 17:23:51 +0000 (13:23 -0400)
when we hit a timeout, we signal the frames to cancel.  If pushing
the timer section onto the stack fails, we signal the entire
request to cancel.

src/lib/unlang/interpret.c
src/lib/unlang/interpret_priv.h
src/lib/unlang/timeout.c

index 466a277038e69404ddaaffc63c2999d9d52ccf3a..8e6cd1cb0cee927d3bf27edf65a51a970f3a1ce5 100644 (file)
@@ -1113,6 +1113,7 @@ void unlang_interpret_request_done(request_t *request)
        request->master_state = REQUEST_DONE;
 }
 
+static inline CC_HINT(always_inline)
 void unlang_interpret_request_stop(request_t *request)
 {
        unlang_stack_t          *stack = request->stack;
index 74209bdfaf499ba51cfa68d3e094f85df608e857..e504fd93aa082e2c742379ffb04987fda23f8ad3 100644 (file)
@@ -45,8 +45,6 @@ static inline void interpret_child_init(request_t *request)
        intp->funcs.init_internal(request, intp->uctx);
 }
 
-void   unlang_interpret_request_stop(request_t *request);
-
 #ifdef __cplusplus
 }
 #endif
index 50e901ee8da5a4d7a834b077d6f00b61dc37664d..8349f7aee641f699182893679ca9fca000fa1b8a 100644 (file)
@@ -55,7 +55,7 @@ static void unlang_timeout_handler(UNUSED fr_timer_list_t *tl, UNUSED fr_time_t
        unlang_interpret_mark_runnable(request);
 
        /*
-        *      Signal all lower frames to exit.
+        *      Signal all lower frames to exit, but the request can keep running.
         */
        unlang_frame_signal(request, FR_SIGNAL_CANCEL, state->depth);
        state->success = false;
@@ -63,8 +63,7 @@ static void unlang_timeout_handler(UNUSED fr_timer_list_t *tl, UNUSED fr_time_t
        if (!state->instruction) return;
 
        if (unlang_interpret_push_instruction(request, state->instruction, RLM_MODULE_FAIL, true) < 0) {
-               REDEBUG("Failed pushing timeout instruction - cancelling the request");
-               unlang_interpret_request_stop(request);
+               unlang_interpret_signal(request, FR_SIGNAL_CANCEL); /* also stops the request and does cleanups */
        }
 }