]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
change name to "mark" resumable
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2020 18:27:54 +0000 (13:27 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Dec 2020 18:33:16 +0000 (13:33 -0500)
which is clearer, and lets us add a check for *is* resumable

16 files changed:
src/lib/curl/io.c
src/lib/unlang/interpret.c
src/lib/unlang/interpret.h
src/lib/unlang/io.c
src/lib/unlang/module.c
src/lib/unlang/module.h
src/lib/unlang/parallel.c
src/lib/unlang/tmpl.c
src/lib/unlang/tmpl.h
src/lib/unlang/xlat.c
src/lib/unlang/xlat.h
src/modules/rlm_delay/rlm_delay.c
src/modules/rlm_icmp/rlm_icmp.c
src/modules/rlm_radius/rlm_radius.c
src/modules/rlm_radius/rlm_radius_udp.c
src/modules/rlm_sigtran/client.c

index f43d2d33be6d2c96a33632bba83dd9828a2dca23..10b2d8b7354919f0df81136d1b3b8b36315a615c 100644 (file)
@@ -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;
 
index fc6c3e82b3ca697a4a95c6366fdba6d55e28343a..63b52a27f7c2c1298f2c45dbff1cf5388db61450 100644 (file)
@@ -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];
index 81d8ebeedf353c0bf2fe7e52981df8d0d76811e4..043c3af4c8ab297ebd39bf3e80c91f2c1d8fcc09 100644 (file)
@@ -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);
 
index 54e13e92ef6fabbf96d6cddb157223b6851f652a..720ac5f14aeabba9a916de0a33d3d9ba7df22f89 100644 (file)
@@ -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.
index 1d797ebc98ef39d07580bbe2080f79d8e771d6cb..d0cf0a2961f7f4714b530c83d0709a0809e49461 100644 (file)
@@ -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
index 7ce0cab581e0447c433395d1cae7a268f05925a3..42fc7d0cfb4ce96cf2910332d6f0b8dfb9174bfc 100644 (file)
@@ -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.
index bec941ca5579e1e2ac0b7cfe92b1aa74fb53892f..3d71c4d23953f8725a7c19e697df06ff399a20ea 100644 (file)
@@ -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;
index 4746e3c8751ac3b89cb642331bf4e1531429093e..ac5e38f265e31574df84cb66659e7c9ec8b7b3c3 100644 (file)
@@ -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);
 }
 
 
index f09da6b52f2642e6dc92372cd8fc7948eb01af53..966db00caa3bd1147c80985dbe122c8f3af4b17e 100644 (file)
@@ -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.
index cba32b83deaa494a327a9816a50cbfca843c93a8..1861055b5a7329e6db6c76c540b72ba4a3168d7b 100644 (file)
@@ -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.
index cc8c4c615f944fc46561eb5c36bf212a8121a1da..d93d129a24c7830faaa08d356ce6c7e9075abbd7 100644 (file)
@@ -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.
index 9b9ad8b0f855b70586f75b259cfe8b59550b70c0..749ca590f399f44b07e0d4144d3d78c8426b8552 100644 (file)
@@ -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,
index 78a94466e4a191ba1d806e56a860ab30b264d73c..324f5e2627bc9184a4063213d4dca20d60ce5ec3 100644 (file)
@@ -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,
index 3398bd380e25032698aba93efd5188b37fa34169..beb239735c51ec33916429b8a15853b108a494cf 100644 (file)
@@ -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)
index 7c4c781520edb77110d824fdc86a690eef2b41a1..094c9c4313f23cf7238ac34e1763b4321340a290 100644 (file)
@@ -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
index 9de7576f001bbd6e493853a9f11abdd5c78b7c7e..65ca34e3269c5d39d502ec44ae2cefaae392c79a 100644 (file)
@@ -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