From: Alan T. DeKok Date: Fri, 18 Apr 2025 17:23:51 +0000 (-0400) Subject: distinguish frame_signal and interpret_signal X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db3328d110e7bdbf2fed281c95b61d1c8535b0cf;p=thirdparty%2Ffreeradius-server.git distinguish frame_signal and interpret_signal 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. --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 466a277038e..8e6cd1cb0ce 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -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; diff --git a/src/lib/unlang/interpret_priv.h b/src/lib/unlang/interpret_priv.h index 74209bdfaf4..e504fd93aa0 100644 --- a/src/lib/unlang/interpret_priv.h +++ b/src/lib/unlang/interpret_priv.h @@ -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 diff --git a/src/lib/unlang/timeout.c b/src/lib/unlang/timeout.c index 50e901ee8da..8349f7aee64 100644 --- a/src/lib/unlang/timeout.c +++ b/src/lib/unlang/timeout.c @@ -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 */ } }