From: Alan T. DeKok Date: Mon, 14 Dec 2020 18:27:54 +0000 (-0500) Subject: change name to "mark" resumable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c629dadfbf1713b5322b035ad352bedba28e6d8;p=thirdparty%2Ffreeradius-server.git change name to "mark" resumable which is clearer, and lets us add a check for *is* resumable --- diff --git a/src/lib/curl/io.c b/src/lib/curl/io.c index f43d2d33be6..10b2d8b7354 100644 --- a/src/lib/curl/io.c +++ b/src/lib/curl/io.c @@ -95,7 +95,7 @@ static inline void _fr_curl_io_demux(fr_curl_handle_t *mhandle, CURLM *mandle) */ curl_multi_remove_handle(mandle, candle); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } break; diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index fc6c3e82b3c..63b52a27f7c 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -1169,7 +1169,7 @@ rlm_rcode_t unlang_interpret_stack_result(request_t *request) * * @param[in] request The current request. */ -void unlang_interpret_resumable(request_t *request) +void unlang_interpret_mark_resumable(request_t *request) { unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth]; diff --git a/src/lib/unlang/interpret.h b/src/lib/unlang/interpret.h index 81d8ebeedf3..043c3af4c8a 100644 --- a/src/lib/unlang/interpret.h +++ b/src/lib/unlang/interpret.h @@ -114,7 +114,7 @@ rlm_rcode_t unlang_interpret_synchronous(request_t *request, CONF_SECTION *cs, r void *unlang_interpret_stack_alloc(TALLOC_CTX *ctx); -void unlang_interpret_resumable(request_t *request); +void unlang_interpret_mark_resumable(request_t *request); void unlang_interpret_signal(request_t *request, fr_state_signal_t action); diff --git a/src/lib/unlang/io.c b/src/lib/unlang/io.c index 54e13e92ef6..720ac5f14ae 100644 --- a/src/lib/unlang/io.c +++ b/src/lib/unlang/io.c @@ -56,7 +56,7 @@ unlang_action_t unlang_io_process_interpret(rlm_rcode_t *p_result, UNUSED module * If we have a parent, then we're running synchronously * with it. Allow the parent to resume. */ - if (request->parent) unlang_interpret_resumable(request->parent); + if (request->parent) unlang_interpret_mark_resumable(request->parent); /* * Don't bother setting request->reply->code. diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index 1d797ebc98e..d0cf0a2961f 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -124,7 +124,7 @@ static void unlang_module_event_timeout_handler(UNUSED fr_event_list_t *el, fr_t * Used when a module needs wait for an event. Typically the callback is set, and then the * module returns unlang_module_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(). + * @note The callback is automatically removed on unlang_interpret_mark_resumable(). * * param[in] request the current request. * param[in] callback to call. @@ -241,7 +241,7 @@ static void unlang_event_fd_error_handler(UNUSED fr_event_list_t *el, int fd, * Used when a module needs to read from an FD. Typically the callback is set, and then the * module returns unlang_module_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(). + * @note The callback is automatically removed on unlang_interpret_mark_resumable(). * * @param[in] request The current request. * @param[in] read callback. Used for receiving and demuxing/decoding data. @@ -739,7 +739,7 @@ static unlang_action_t unlang_module_resume(rlm_rcode_t *p_result, request_t *re * A common pattern is to use ``return unlang_module_yield(...)``. * * @param[in] request The current request. - * @param[in] resume Called on unlang_interpret_resumable(). + * @param[in] resume Called on unlang_interpret_mark_resumable(). * @param[in] signal Called on unlang_action(). * @param[in] rctx to pass to the callbacks. * @return diff --git a/src/lib/unlang/module.h b/src/lib/unlang/module.h index 7ce0cab581e..42fc7d0cfb4 100644 --- a/src/lib/unlang/module.h +++ b/src/lib/unlang/module.h @@ -39,7 +39,7 @@ extern "C" { * Used when a module needs wait for an event. * Typically the callback is set, and then the module returns unlang_module_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(), i.e. if an event + * @note The callback is automatically removed on unlang_interpret_mark_resumable(), i.e. if an event * on a registered FD occurs before the timeout event fires. * * @param[in] mctx calling context for the module. @@ -55,7 +55,7 @@ typedef void (*unlang_module_timeout_t)(module_ctx_t const *mctx, request_t *req * Used when a module needs to read from an FD. Typically the callback is set, and then the * module returns unlang_module_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(), so + * @note The callback is automatically removed on unlang_interpret_mark_resumable(), so * * @param[in] mctx calling context for the module. * Contains global, thread-specific, and call-specific data for a module. @@ -84,7 +84,7 @@ typedef unlang_action_t (*unlang_module_resume_t)(rlm_rcode_t *p_result, module_ * A module may call unlang_yeild(), but still need to do something on FR_SIGNAL_DUP. If so, it's * set here. * - * @note The callback is automatically removed on unlang_interpret_resumable(). + * @note The callback is automatically removed on unlang_interpret_mark_resumable(). * * @param[in] mctx calling context for the module. * Contains global, thread-specific, and call-specific data for a module. diff --git a/src/lib/unlang/parallel.c b/src/lib/unlang/parallel.c index bec941ca557..3d71c4d2395 100644 --- a/src/lib/unlang/parallel.c +++ b/src/lib/unlang/parallel.c @@ -45,13 +45,13 @@ static unlang_action_t unlang_parallel_child_done(UNUSED rlm_rcode_t *p_result, * the parent anything. Because we have that kind of * relationship. * - * Note that we call unlang_interpret_resumable() here + * Note that we call unlang_interpret_mark_resumable() here * because unlang_parallel_process() calls * unlang_interpret(), and NOT child->async->process. */ if (request->parent) { child->state = CHILD_EXITED; - unlang_interpret_resumable(request->parent); + unlang_interpret_mark_resumable(request->parent); } /* @@ -272,7 +272,7 @@ static unlang_action_t unlang_parallel_process(rlm_rcode_t *p_result, request_t case CHILD_YIELDED: fr_assert(state->children[i].child != NULL); - if (state->children[i].child->runnable_id == -2) { /* see unlang_interpret_resumable() */ + if (state->children[i].child->runnable_id == -2) { /* see unlang_interpret_mark_resumable() */ (void) fr_heap_extract(state->children[i].child->backlog, state->children[i].child); goto runnable; diff --git a/src/lib/unlang/tmpl.c b/src/lib/unlang/tmpl.c index 4746e3c8751..ac5e38f265e 100644 --- a/src/lib/unlang/tmpl.c +++ b/src/lib/unlang/tmpl.c @@ -186,7 +186,7 @@ static void unlang_tmpl_exec_waitpid(UNUSED fr_event_list_t *el, UNUSED pid_t pi if (state->ev) fr_event_timer_delete(&state->ev); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } static void unlang_tmpl_exec_read(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx) @@ -208,7 +208,7 @@ static void unlang_tmpl_exec_read(UNUSED fr_event_list_t *el, UNUSED int fd, UNU REDEBUG("Error reading from child program - %s", fr_syserror(errno)); unlang_tmpl_exec_cleanup(request); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); return; } @@ -280,7 +280,7 @@ static void unlang_tmpl_exec_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_ state->failed = true; unlang_tmpl_exec_cleanup(request); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } diff --git a/src/lib/unlang/tmpl.h b/src/lib/unlang/tmpl.h index f09da6b52f2..966db00caa3 100644 --- a/src/lib/unlang/tmpl.h +++ b/src/lib/unlang/tmpl.h @@ -39,7 +39,7 @@ extern "C" { * A module may call unlang_yeild(), but still need to do something on FR_SIGNAL_DUP. If so, it's * set here. * - * @note The callback is automatically removed on unlang_interpret_resumable(). + * @note The callback is automatically removed on unlang_interpret_mark_resumable(). * * @param[in] rctx Resume ctx for the callback. * @param[in] request The current request. diff --git a/src/lib/unlang/xlat.c b/src/lib/unlang/xlat.c index cba32b83dea..1861055b5a7 100644 --- a/src/lib/unlang/xlat.c +++ b/src/lib/unlang/xlat.c @@ -373,7 +373,7 @@ static unlang_action_t unlang_xlat_resume(rlm_rcode_t *p_result, request_t *requ * A common pattern is to use ``return unlang_xlat_yield(...)``. * * @param[in] request The current request. - * @param[in] resume Called on unlang_interpret_resumable(). + * @param[in] resume Called on unlang_interpret_mark_resumable(). * @param[in] signal Called on unlang_action(). * @param[in] rctx to pass to the callbacks. * @return always returns RLM_MODULE_YIELD. diff --git a/src/lib/unlang/xlat.h b/src/lib/unlang/xlat.h index cc8c4c615f9..d93d129a24c 100644 --- a/src/lib/unlang/xlat.h +++ b/src/lib/unlang/xlat.h @@ -91,7 +91,7 @@ extern size_t xlat_action_table_len; * Used when a xlat needs wait for an event. * Typically the callback is set, and then the xlat returns unlang_xlat_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(), i.e. if an event + * @note The callback is automatically removed on unlang_interpret_mark_resumable(), i.e. if an event * on a registered FD occurs before the timeout event fires. * * @param[in] request the request. @@ -108,7 +108,7 @@ typedef void (*fr_unlang_xlat_timeout_t)(request_t *request, void *xlat_inst, * Used when a xlat needs to read from an FD. Typically the callback is set, and then the * xlat returns unlang_xlat_yield(). * - * @note The callback is automatically removed on unlang_interpret_resumable(), so + * @note The callback is automatically removed on unlang_interpret_mark_resumable(), so * * @param[in] request the current request. * @param[in] xlat_inst the xlat instance. @@ -166,7 +166,7 @@ typedef xlat_action_t (*xlat_func_resume_t)(TALLOC_CTX *ctx, fr_cursor_t *out, /** A callback when the request gets a fr_state_signal_t. * - * @note The callback is automatically removed on unlang_interpret_resumable(). + * @note The callback is automatically removed on unlang_interpret_mark_resumable(). * * @param[in] request The current request. * @param[in] xlat_inst the xlat instance. diff --git a/src/modules/rlm_delay/rlm_delay.c b/src/modules/rlm_delay/rlm_delay.c index 9b9ad8b0f85..749ca590f39 100644 --- a/src/modules/rlm_delay/rlm_delay.c +++ b/src/modules/rlm_delay/rlm_delay.c @@ -64,7 +64,7 @@ static void _delay_done(UNUSED module_ctx_t const *mctx, request_t *request, voi */ if (!fr_cond_assert(fired >= *yielded)) REDEBUG("Unexpected resume time"); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } static void _xlat_delay_done(request_t *request, @@ -80,7 +80,7 @@ static void _xlat_delay_done(request_t *request, */ if (!fr_cond_assert(fired > *yielded)) REDEBUG("Unexpected resume time"); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } static int delay_add(request_t *request, fr_time_t *resume_at, fr_time_t now, diff --git a/src/modules/rlm_icmp/rlm_icmp.c b/src/modules/rlm_icmp/rlm_icmp.c index 78a94466e4a..324f5e2627b 100644 --- a/src/modules/rlm_icmp/rlm_icmp.c +++ b/src/modules/rlm_icmp/rlm_icmp.c @@ -166,7 +166,7 @@ static void _xlat_icmp_timeout(request_t *request, RDEBUG2("No response to ICMP request for %pV (counter=%d)", echo->ip, echo->counter); - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } /** Xlat to delay the request @@ -375,7 +375,7 @@ static void mod_icmp_read(UNUSED fr_event_list_t *el, UNUSED int sockfd, UNUSED * We have a reply! */ echo->replied = true; - unlang_interpret_resumable(echo->request); + unlang_interpret_mark_resumable(echo->request); } static void mod_icmp_error(fr_event_list_t *el, UNUSED int sockfd, UNUSED int flags, diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index 3398bd380e2..beb239735c5 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -381,7 +381,7 @@ static void mod_radius_signal(module_ctx_t const *mctx, request_t *request, void } -/** Continue after unlang_interpret_resumable() +/** Continue after unlang_interpret_mark_resumable() * */ static unlang_action_t mod_radius_resume(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, void *ctx) diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 7c4c781520e..094c9c4313f 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -2553,7 +2553,7 @@ static void request_fail(request_t *request, void *preq, void *rctx, r->rcode = RLM_MODULE_FAIL; r->treq = NULL; - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } /** Response has already been written to the rctx at this point @@ -2570,7 +2570,7 @@ static void request_complete(request_t *request, void *preq, void *rctx, UNUSED r->treq = NULL; - unlang_interpret_resumable(request); + unlang_interpret_mark_resumable(request); } /** Explicitly free resources associated with the protocol request diff --git a/src/modules/rlm_sigtran/client.c b/src/modules/rlm_sigtran/client.c index 9de7576f001..65ca34e3269 100644 --- a/src/modules/rlm_sigtran/client.c +++ b/src/modules/rlm_sigtran/client.c @@ -133,7 +133,7 @@ static void _sigtran_pipe_read(UNUSED fr_event_list_t *el, int fd, UNUSED int fl if (txn->ctx.defunct) return; /* Request was stopped */ fr_assert(txn->ctx.request); - unlang_interpret_resumable(txn->ctx.request); /* Continue processing */ + unlang_interpret_mark_resumable(txn->ctx.request); /* Continue processing */ } /** Called by a new thread to register a new req_pipe