From: Arran Cudbard-Bell Date: Sat, 18 Mar 2023 04:36:56 +0000 (-0400) Subject: cancel: Insert dummy resume function to keep interpreter happy X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40d256eaddabaa5941d232f467ae8996e01250e8;p=thirdparty%2Ffreeradius-server.git cancel: Insert dummy resume function to keep interpreter happy --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 7095094a540..5a62a99db3b 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -1315,6 +1315,14 @@ static void unlang_cancel_event(UNUSED fr_event_list_t *el, UNUSED fr_time_t now talloc_free(request_data_get(request, (void *)unlang_cancel_xlat, 0)); } +static xlat_action_t unlang_cancel_never_run(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, + UNUSED xlat_ctx_t const *xctx, + UNUSED request_t *request, UNUSED fr_value_box_list_t *in) +{ + fr_assert_msg(0, "Should never be run"); + return XLAT_ACTION_FAIL; +} + /** Allows a request to dynamically alter its own lifetime * */ @@ -1363,8 +1371,11 @@ static xlat_action_t unlang_cancel_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, * No timeout means cancel immediately, so yield allowing * the interpreter to run the event we added to cancel * the request. + * + * We call unlang_xlat_yield to keep the interpreter happy + * as it expects to see a resume function set. */ - if (!timeout) return XLAT_ACTION_YIELD; + if (!timeout) return unlang_xlat_yield(request, unlang_cancel_never_run, NULL, NULL); if (ev_p_og) { MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_TIME_DELTA, NULL, false));