Skip to content

Commit 5510877

Browse files
committed
cancel includes the current depth
1 parent fbf132f commit 5510877

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib/unlang/interpret.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ static void instruction_retry_handler(UNUSED fr_timer_list_t *tl, UNUSED fr_time
14971497
/*
14981498
* Signal all lower frames to exit.
14991499
*/
1500-
unlang_stack_signal(request, FR_SIGNAL_CANCEL, retry->depth);
1500+
unlang_stack_signal(request, FR_SIGNAL_CANCEL, retry->depth + 1);
15011501

15021502
retry->state = FR_RETRY_MRD;
15031503
unlang_interpret_mark_runnable(request);

src/lib/unlang/unlang_priv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,12 +559,12 @@ static inline unsigned int unlang_frame_by_op_flag(unlang_stack_t *stack, unlang
559559
* the request.
560560
*
561561
* @param[in] stack The current stack.
562-
* @param[in] to_depth mark all frames below this depth as cancelled.
562+
* @param[in] to_depth mark all frames up to and including this depth as cancelled.
563563
*/
564564
static inline unlang_action_t unwind_to_depth(unlang_stack_t *stack, unsigned int to_depth)
565565
{
566566
unlang_stack_frame_t *frame;
567-
unsigned int i, depth = stack->depth; /* must be signed to avoid underflow */
567+
unsigned int i, depth = stack->depth;
568568

569569
if (!fr_cond_assert(to_depth >= 1)) return UNLANG_ACTION_FAIL;
570570

0 commit comments

Comments
 (0)