]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Mark runnable not mark resumable
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 18 Mar 2021 20:52:34 +0000 (20:52 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 18 Mar 2021 20:53:12 +0000 (20:53 +0000)
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 d91e357427bbec0de1468b6ff2c91b7d1dc2c7f6..22bb491ca0dbfbd65bc4e2ed4d48bc02bf2213d8 100644 (file)
@@ -91,7 +91,7 @@ static inline void _fr_curl_io_demux(fr_curl_handle_t *mhandle, CURLM *mandle)
                         */
                        curl_multi_remove_handle(mandle, candle);
 
-                       unlang_interpret_mark_resumable(request);
+                       unlang_interpret_mark_runnable(request);
                }
                        break;
 
index a59992077d30e47c24964b12fbd6feedf6353a56..4f73f25a0b54351fc2086162c3eb6f73ff72b431 100644 (file)
@@ -1171,7 +1171,7 @@ bool unlang_interpret_is_resumable(request_t *request)
  *
  * @param[in] request          The current request.
  */
-void unlang_interpret_mark_resumable(request_t *request)
+void unlang_interpret_mark_runnable(request_t *request)
 {
        unlang_stack_t                  *stack = request->stack;
        unlang_stack_frame_t            *frame = &stack->frame[stack->depth];
index eccbfccba358b0c0945c6369a65a3d5182ce2c59..21c6e8a18587f353bb274ea7fb189941df005487 100644 (file)
@@ -60,7 +60,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_mark_resumable(request_t *request);
+void           unlang_interpret_mark_runnable(request_t *request);
 
 bool           unlang_interpret_is_resumable(request_t *request);
 
index 4f710aed8141422dcf9778718a76b6eed4a8922e..613001f44a03d796b91d95412979644b3981a7b7 100644 (file)
@@ -27,35 +27,6 @@ RCSID("$Id$")
 #include <freeradius-devel/io/listen.h>
 #include "unlang_priv.h"
 
-/** Run the interpreter after creating a subrequest.
- *
- * Just run some "unlang", but don't do anything else.
- *
- * This is a shim function added to 'fake' requests by the subrequest and parallel keywords.
- */
-unlang_action_t unlang_io_process_interpret(rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
-{
-       rlm_rcode_t rcode;
-
-       REQUEST_VERIFY(request);
-
-       rcode = unlang_interpret(request);
-
-       /*
-        *      We've yielded, and can keep running.  Do so.
-        */
-       if ((rcode == RLM_MODULE_YIELD) &&
-           (request->master_state != REQUEST_STOP_PROCESSING)) {
-               *p_result = RLM_MODULE_YIELD;
-               return UNLANG_ACTION_YIELD;
-       }
-
-       /*
-        *      Don't bother setting request->reply->code.
-        */
-       RETURN_MODULE_HANDLED;
-}
-
 /** Allocate a child request based on the parent.
  *
  * @param[in] parent           spawning the child request.
index c1684fc1279c44f71bf95fc9578c080c7e04dd7a..d5a485efe9f523521f0ee62760a436a5d07ae986 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_mark_resumable().
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable().
  *
  * param[in] request           the current request.
  * param[in] callback          to call.
@@ -243,7 +243,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_mark_resumable().
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable().
  *
  * @param[in] request          The current request.
  * @param[in] read             callback.  Used for receiving and demuxing/decoding data.
@@ -736,7 +736,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_mark_resumable().
+ * @param[in] resume           Called on unlang_interpret_mark_runnable().
  * @param[in] signal           Called on unlang_action().
  * @param[in] rctx             to pass to the callbacks.
  * @return
index e03989bb25db10aebc6459b224c9d82b2097b3a5..103ecb41991833382f430fd34c7a043abe69dd39 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_mark_resumable(), i.e. if an event
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable(), 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_mark_resumable(), so
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable(), 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_mark_resumable().
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable().
  *
  * @param[in] mctx             calling context for the module.
  *                             Contains global, thread-specific, and call-specific data for a module.
index 0c3721976f29d65c2e8ad2691c60ab30cd7bb733..658ecfb7c83162e738c88dbffcf24758beb365ed 100644 (file)
@@ -131,7 +131,7 @@ static void unlang_parallel_child_signal(request_t *request, fr_state_signal_t a
         */
        if (state->num_complete == state->num_children) {
                RDEBUG3("Signalling parent %s that all children have EXITED or DETACHED", request->parent->name);
-               unlang_interpret_mark_resumable(request->parent);
+               unlang_interpret_mark_runnable(request->parent);
        }
 
        return;
@@ -153,7 +153,7 @@ 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_mark_resumable() here
+        *      Note that we call unlang_interpret_mark_runnable() here
         *      because unlang_parallel_process() calls
         *      unlang_interpret(), and NOT child->async->process.
         */
@@ -177,7 +177,7 @@ static unlang_action_t unlang_parallel_child_done(UNUSED rlm_rcode_t *p_result,
                 */
                if (state->num_complete == state->num_children) {
                        RDEBUG3("Signalling parent %s that all children have EXITED or DETACHED", request->parent->name);
-                       unlang_interpret_mark_resumable(request->parent);
+                       unlang_interpret_mark_runnable(request->parent);
                }
        }
 
index 908b6eb9552fd22e36155c3ee10672be2b51c93f..bf5a1d0879651f7393e249565df12afe3dac032a 100644 (file)
@@ -203,7 +203,7 @@ static void unlang_tmpl_exec_waitpid(UNUSED fr_event_list_t *el, UNUSED pid_t pi
 
        if (state->exec.ev) fr_event_timer_delete(&state->exec.ev);
 
-       unlang_interpret_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 static void unlang_tmpl_exec_stdout_read(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
@@ -308,7 +308,7 @@ static void unlang_tmpl_exec_timeout(
        state->exec.failed = true;
 
        unlang_tmpl_exec_cleanup(request);
-       unlang_interpret_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 
index e3a5030c8c358837ef6b176847ec08f52efea9ea..6104510c413dd1876e388801d6358bedfed45c20 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_mark_resumable().
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable().
  *
  * @param[in] rctx             Resume ctx for the callback.
  * @param[in] request          The current request.
index 73493e8fffbced7725f53facb0b5127c104dd4c7..05a78193b442bc358b9fb93ef78cd11360975f66 100644 (file)
@@ -370,7 +370,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_mark_resumable().
+ * @param[in] resume           Called on unlang_interpret_mark_runnable().
  * @param[in] signal           Called on unlang_action().
  * @param[in] rctx             to pass to the callbacks.
  * @return always returns RLM_MODULE_YIELD.
index 1d63e5a5662717d1a9ba9f857f7836572935f327..98d9abc6d28258a88a8e06ced664c3c34957d822 100644 (file)
@@ -131,7 +131,7 @@ typedef struct {
  * 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_mark_resumable(), i.e. if an event
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable(), i.e. if an event
  *     on a registered FD occurs before the timeout event fires.
  *
  * @param[in] request          the request.
@@ -148,7 +148,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_mark_resumable(), so
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable(), so
  *
  * @param[in] request          the current request.
  * @param[in] xlat_inst                the xlat instance.
@@ -206,7 +206,7 @@ typedef xlat_action_t (*xlat_func_resume_t)(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
 /** A callback when the request gets a fr_state_signal_t.
  *
- * @note The callback is automatically removed on unlang_interpret_mark_resumable().
+ * @note The callback is automatically removed on unlang_interpret_mark_runnable().
  *
  * @param[in] request          The current request.
  * @param[in] xlat_inst                the xlat instance.
index 42630d8c8ac8cbc0fbade2bf1d4fcb5c1de2579e..d362426fae3f4769e7672e5f18a953cad9931bde 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_mark_resumable(request);
+       unlang_interpret_mark_runnable(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_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 static int delay_add(request_t *request, fr_time_t *resume_at, fr_time_t now,
index 8bf089fbf412762b58af9b3817e6dc80a3e79d8f..a0f29f9ae0289c2c808810275c4b12cb9d1dc15d 100644 (file)
@@ -167,7 +167,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_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 /** Xlat to delay the request
@@ -377,7 +377,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_mark_resumable(echo->request);
+       unlang_interpret_mark_runnable(echo->request);
 }
 
 static void mod_icmp_error(fr_event_list_t *el, UNUSED int sockfd, UNUSED int flags,
index 84c94fbac722195097ddca40e3246efaf3cd5c83..9164cc5831204a398f6f0f9a70197e49bac06607 100644 (file)
@@ -380,7 +380,7 @@ static void mod_radius_signal(module_ctx_t const *mctx, request_t *request, void
 }
 
 
-/** Continue after unlang_interpret_mark_resumable()
+/** Continue after unlang_interpret_mark_runnable()
  *
  */
 static unlang_action_t mod_radius_resume(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request, void *ctx)
index 738d8ed214028bcead80f0f594d7c74c4a25fab5..9f33388629b16a7f541ca196792e1e54e19f23dd 100644 (file)
@@ -2555,7 +2555,7 @@ static void request_fail(request_t *request, void *preq, void *rctx,
        r->rcode = RLM_MODULE_FAIL;
        r->treq = NULL;
 
-       unlang_interpret_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 /** Response has already been written to the rctx at this point
@@ -2572,7 +2572,7 @@ static void request_complete(request_t *request, void *preq, void *rctx, UNUSED
 
        r->treq = NULL;
 
-       unlang_interpret_mark_resumable(request);
+       unlang_interpret_mark_runnable(request);
 }
 
 /** Explicitly free resources associated with the protocol request
index 261f54f8f5229f6617c790cd9a54fbe9aa8df4c1..4673a33c03ceb017a69938ce38c517b46af7d47d 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_mark_resumable(txn->ctx.request);      /* Continue processing */
+       unlang_interpret_mark_runnable(txn->ctx.request);       /* Continue processing */
 }
 
 /** Called by a new thread to register a new req_pipe