if (unlang_function_push(request,
NULL,
eap_tls_handshake_resume,
- NULL, UNLANG_SUB_FRAME, eap_session) < 0) return UNLANG_ACTION_FAIL;
+ NULL, 0, UNLANG_SUB_FRAME, eap_session) < 0) return UNLANG_ACTION_FAIL;
if (fr_tls_session_async_handshake_push(request, tls_session) < 0) return UNLANG_ACTION_FAIL;
* frame when the state machine finishes with
* this round.
*/
- (void)unlang_module_yield(request, mod_encode, NULL, NULL);
+ (void)unlang_module_yield(request, mod_encode, NULL, 0, NULL);
if (virtual_server_push(request, inst->virtual_server, UNLANG_SUB_FRAME) < 0) {
unlang_interpet_frame_discard(request);
RLM_MODULE_NOOP, \
resume_ ## _x, \
mod_signal, \
+ ~FR_SIGNAL_CANCEL, \
talloc_get_type_abort(mctx->rctx, eap_aka_sim_session_t))
/*
* @param[in] request The current request.
* @param[in] action to perform.
*/
-static void mod_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_signal(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Request cancelled - Destroying session");
/*
RLM_MODULE_NOOP,
resume_recv_aka_identity_response,
mod_signal,
+ ~FR_SIGNAL_CANCEL,
eap_aka_sim_session);
}
RLM_MODULE_NOOP,
resume_send_aka_identity_request,
mod_signal,
+ ~FR_SIGNAL_CANCEL,
eap_aka_sim_session);
}
RLM_MODULE_NOOP,
resume_recv_sim_start_response,
mod_signal,
+ ~FR_SIGNAL_CANCEL,
eap_aka_sim_session);
}
RLM_MODULE_NOOP,
resume_send_sim_start,
mod_signal,
+ ~FR_SIGNAL_CANCEL,
eap_aka_sim_session);
}
/** Signal an LDAP query running on a trunk connection to cancel
*
*/
-static void ldap_trunk_query_cancel(UNUSED request_t *request, fr_state_signal_t action, void *uctx)
+static void ldap_trunk_query_cancel(UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx)
{
fr_ldap_query_t *query = talloc_get_type_abort(uctx, fr_ldap_query_t);
- if (action != FR_SIGNAL_CANCEL) return;
/*
* Query may have completed, but the request
* not yet have been resumed.
}
action = unlang_function_push(request, is_async ? NULL : ldap_trunk_query_start, ldap_trunk_query_results,
- ldap_trunk_query_cancel, is_async ? UNLANG_SUB_FRAME : UNLANG_TOP_FRAME, query);
+ ldap_trunk_query_cancel, ~FR_SIGNAL_CANCEL, is_async ? UNLANG_SUB_FRAME : UNLANG_TOP_FRAME, query);
if (action == UNLANG_ACTION_FAIL) goto error;
}
action = unlang_function_push(request, is_async ? NULL : ldap_trunk_query_start, ldap_trunk_query_results,
- ldap_trunk_query_cancel, is_async ? UNLANG_SUB_FRAME : UNLANG_TOP_FRAME, query);
+ ldap_trunk_query_cancel, ~FR_SIGNAL_CANCEL, is_async ? UNLANG_SUB_FRAME : UNLANG_TOP_FRAME, query);
if (action == UNLANG_ACTION_FAIL) goto error;
/** Signal an outstanding LDAP bind request to cancel
*
*/
-static void ldap_async_auth_bind_cancel(UNUSED request_t *request, fr_state_signal_t action, void *uctx)
+static void ldap_async_auth_bind_cancel(UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx)
{
fr_ldap_bind_auth_ctx_t *bind_auth_ctx = talloc_get_type_abort(uctx, fr_ldap_bind_auth_ctx_t);
- if (action != FR_SIGNAL_CANCEL) return;
-
ldap_abandon_ext(bind_auth_ctx->bind_ctx->c->handle, bind_auth_ctx->msgid, NULL, NULL);
fr_rb_remove(bind_auth_ctx->thread->binds, bind_auth_ctx);
bind_auth_ctx->thread = thread;
bind_auth_ctx->ret = LDAP_RESULT_PENDING;
- return unlang_function_push(request, ldap_async_auth_bind_start, ldap_async_auth_bind_results, ldap_async_auth_bind_cancel, UNLANG_TOP_FRAME, bind_auth_ctx);
+ return unlang_function_push(request,
+ ldap_async_auth_bind_start,
+ ldap_async_auth_bind_results,
+ ldap_async_auth_bind_cancel,
+ ~FR_SIGNAL_CANCEL, UNLANG_TOP_FRAME, bind_auth_ctx);
}
if (cs) RDEBUG("Running '%s %s' from file %s", cf_section_name1(cs), cf_section_name2(cs), cf_filename(cs));
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->resume,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME(recv_generic)
fr_assert(state->send != NULL);
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->send,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME_NO_MCTX(recv_no_send)
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->resume,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME(send_generic)
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->send,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
fr_assert(!state->packet_type[rcode] || (state->packet_type[rcode] == request->reply->code));
REQUEST_OTHER_4,
} request_state_t;
-typedef void (*fr_request_process_t)(request_t *, fr_state_signal_t); //!< Function handler for requests.
+typedef void (*fr_request_process_t)(request_t *, fr_signal_t); //!< Function handler for requests.
typedef rlm_rcode_t (*RAD_REQUEST_FUNP)(request_t *);
extern HIDDEN fr_dict_attr_t const *request_attr_root;
/** Signals that can be generated/processed by request signal handlers
*
+ * This is a bitfield so that it can be used to specify signal masks.
*/
-typedef enum fr_state_signal_t { /* server action */
- FR_SIGNAL_INVALID = 0,
- FR_SIGNAL_RUN,
- FR_SIGNAL_CANCEL, //!< Request has been cancelled. If a module is signalled
- ///< with this, the module should stop processing
- ///< the request and cleanup anything it's done.
- FR_SIGNAL_DUP, //!< A duplicate request was received.
- FR_SIGNAL_DETACH, //!< Request is being detached from its parent.
- FR_SIGNAL_RETRY, //!< a retry timer has hit
- FR_SIGNAL_TIMEOUT //!< a retry timeout or max count has hit
-} fr_state_signal_t;
+DIAG_OFF(attributes) /* Stupid GCC */
+typedef enum CC_HINT(flag_enum) { /* server action */
+ FR_SIGNAL_INVALID = 0x00,
+ FR_SIGNAL_CANCEL = 0x01, //!< Request has been cancelled.
+ ///< If a module is signalled with this, the module
+ ///< should stop processing the request and cleanup
+ ///< anything it's done.
+ FR_SIGNAL_DUP = 0x02, //!< A duplicate request was received.
+ FR_SIGNAL_DETACH = 0x04, //!< Request is being detached from its parent.
+ FR_SIGNAL_RETRY = 0x08, //!< a retry timer has hit
+ FR_SIGNAL_TIMEOUT = 0x10 //!< a retry timeout or max count has hit
+} fr_signal_t;
+DIAG_ON(attributes)
+
+#define fr_signal_is_cancel(_signal) (_signal & FR_SIGNAL_CANCEL)
+#define fr_signal_is_dup(_signal) (_signal & FR_SIGNAL_DUP)
+#define fr_signal_is_detach(_signal) (_signal & FR_SIGNAL_DETACH)
+#define fr_signal_is_retry(_signal) (_signal & FR_SIGNAL_RETRY)
+#define fr_signal_is_timeout(_signal) (_signal & FR_SIGNAL_TIMEOUT)
#ifdef __cplusplus
}
}
if (unlang_function_push(request, trigger_run, trigger_resume,
- NULL, UNLANG_TOP_FRAME, trigger) < 0) goto error;
+ NULL, 0, UNLANG_TOP_FRAME, trigger) < 0) goto error;
if (!intp) {
/*
* @param[in] action we're being signalled with.
* @param[in] uctx the SSL * to cancell.
*/
-static void tls_session_async_handshake_signal(UNUSED request_t *request, fr_state_signal_t action, void *uctx)
+static void tls_session_async_handshake_signal(UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx)
{
fr_tls_session_t *tls_session = talloc_get_type_abort(uctx, fr_tls_session_t);
int ret;
- if (action != FR_SIGNAL_CANCEL) return;
-
/*
* We might want to set can_pause = false here
* but that would trigger asserts in the
tls_session_async_handshake,
NULL,
tls_session_async_handshake_signal,
+ ~FR_SIGNAL_CANCEL,
UNLANG_SUB_FRAME,
tls_session);
}
* subrequest completes.
*/
if (unlang_function_push(child, NULL, resume,
- NULL, UNLANG_SUB_FRAME, tls_session) < 0) return UNLANG_ACTION_FAIL;
+ NULL, 0, UNLANG_SUB_FRAME, tls_session) < 0) return UNLANG_ACTION_FAIL;
/*
* Now the child and parent stacks are both
unlang_function_t repeat; //!< To call when going back up the stack.
char const *repeat_name; //!< Debug name for the repeat function.
unlang_function_signal_t signal; //!< Signal function to call.
+ fr_signal_t sigmask; //!< Signals to block.
char const *signal_name; //!< Debug name for the signal function.
void *uctx; //!< Uctx to pass to function.
} unlang_frame_state_func_t;
* @param[in] action Type of signal.
*/
static void unlang_function_signal(request_t *request,
- unlang_stack_frame_t *frame, fr_state_signal_t action)
+ unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_frame_state_func_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_func_t);
- if (!state->signal) return;
+ if (!state->signal || (action & state->sigmask)) return;
state->signal(request, action, state->uctx);
}
*
* @param[in] request The current request.
* @param[in] signal The signal function to set.
+ * @param[in] sigmask Signals to block.
* @param[in] signal_name Name of the signal function call (for debugging).
* @return
* - 0 on success.
* - -1 on failure.
*/
-int _unlang_function_signal_set(request_t *request, unlang_function_signal_t signal, char const *signal_name)
+int _unlang_function_signal_set(request_t *request, unlang_function_signal_t signal, fr_signal_t sigmask, char const *signal_name)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
* once the current function returns.
*/
state->signal = signal;
+ state->sigmask = sigmask;
state->signal_name = signal_name;
return 0;
* This may be the same as func.
* @param[in] repeat_name Name of the repeat function call (for debugging).
* @param[in] signal function to call if the request is signalled.
+ * @param[in] sigmask Signals to block.
* @param[in] signal_name Name of the signal function call (for debugging).
* @param[in] top_frame Return out of the unlang interpreter when popping this frame.
* @param[in] uctx to pass to func(s).
unlang_action_t _unlang_function_push(request_t *request,
unlang_function_t func, char const *func_name,
unlang_function_t repeat, char const *repeat_name,
- unlang_function_signal_t signal, char const *signal_name,
+ unlang_function_signal_t signal, fr_signal_t sigmask, char const *signal_name,
bool top_frame, void *uctx)
{
unlang_stack_t *stack = request->stack;
state->repeat = repeat;
state->repeat_name = repeat_name;
state->signal = signal;
+ state->sigmask = sigmask;
state->signal_name = signal_name;
state->uctx = uctx;
* interpreter, but should be usable by the function.
* All input (args) and output will be done using this structure.
*/
-typedef void (*unlang_function_signal_t)(request_t *request, fr_state_signal_t action, void *uctx);
+typedef void (*unlang_function_signal_t)(request_t *request, fr_signal_t action, void *uctx);
int unlang_function_clear(request_t *request) CC_HINT(warn_unused_result);
*/
#define unlang_function_signal_set(_request, _signal) \
_unlang_function_signal_set(_request, _signal, STRINGIFY(_signal))
-int _unlang_function_signal_set(request_t *request, unlang_function_signal_t signal, char const *name)
+int _unlang_function_signal_set(request_t *request, unlang_function_signal_t signal, fr_signal_t sigmask, char const *name)
CC_HINT(warn_unused_result);
/** Set a new repeat function for an existing function frame
* @param[in] _repeat function to call going back down the stack (may be NULL).
* This may be the same as func.
* @param[in] _signal function to call if the request is signalled.
+ * @param[in] _sigmask Signals to block.
* @param[in] _top_frame Return out of the unlang interpreter when popping this frame.
* @param[in] _uctx to pass to func(s).
* @return
* - 0 on success.
* - -1 on failure.
*/
-#define unlang_function_push(_request, _func, _repeat, _signal, _top_frame, _uctx) \
+#define unlang_function_push(_request, _func, _repeat, _signal, _sigmask, _top_frame, _uctx) \
_unlang_function_push(_request, \
_func, STRINGIFY(_func), \
_repeat, STRINGIFY(_repeat), \
- _signal, STRINGIFY(_signal), \
+ _signal, _sigmask, STRINGIFY(_signal), \
_top_frame, _uctx)
unlang_action_t _unlang_function_push(request_t *request,
unlang_function_t func, char const *func_name,
unlang_function_t repeat, char const *repeat_name,
- unlang_function_signal_t signal, char const *signal_name,
+ unlang_function_signal_t signal, fr_signal_t sigmask, char const *signal_name,
bool top_frame, void *uctx)
CC_HINT(warn_unused_result);
* @param[in] action to signal.
* @param[in] limit the frame at which to stop signaling.
*/
-void unlang_frame_signal(request_t *request, fr_state_signal_t action, int limit)
+void unlang_frame_signal(request_t *request, fr_signal_t action, int limit)
{
unlang_stack_frame_t *frame;
unlang_stack_t *stack = request->stack;
* @param[in] request The current request.
* @param[in] action to signal.
*/
-void unlang_interpret_signal(request_t *request, fr_state_signal_t action)
+void unlang_interpret_signal(request_t *request, fr_signal_t action)
{
unlang_stack_t *stack = request->stack;
* We call unlang_xlat_yield to keep the interpreter happy
* as it expects to see a resume function set.
*/
- if (!timeout) return unlang_xlat_yield(request, unlang_cancel_never_run, NULL, NULL);
+ if (!timeout) return unlang_xlat_yield(request, unlang_cancel_never_run, NULL, 0, NULL);
if (ev_p_og) {
MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_TIME_DELTA, NULL, false));
bool unlang_interpret_is_resumable(request_t *request);
-void unlang_interpret_signal(request_t *request, fr_state_signal_t action);
+void unlang_interpret_signal(request_t *request, fr_signal_t action);
int unlang_interpret_stack_depth(request_t *request);
* @param[in] frame current stack frame.
* @param[in] action to signal.
*/
-static void unlang_limit_signal(UNUSED request_t *request, unlang_stack_frame_t *frame, fr_state_signal_t action)
+static void unlang_limit_signal(UNUSED request_t *request, unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_frame_state_limit_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_limit_t);
* @param[in] exp XLAT expansion to evaluate.
* @param[in] resume function to call when the XLAT expansion is complete.
* @param[in] signal function to call if a signal is received.
+ * @param[in] sigmask Signals to block.
* @param[in] rctx to pass to the resume() and signal() callbacks.
* @return
* - UNLANG_ACTION_PUSHED_CHILD
unlang_action_t unlang_module_yield_to_xlat(TALLOC_CTX *ctx, bool *p_success, fr_value_box_list_t *out,
request_t *request, xlat_exp_head_t const *exp,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx)
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
{
/*
* Push the resumption point BEFORE pushing the xlat onto
* the parents stack.
*/
- (void) unlang_module_yield(request, resume, signal, rctx);
+ (void) unlang_module_yield(request, resume, signal, sigmask, rctx);
/*
* Push the xlat function
request_t *request, tmpl_t const *vpt,
unlang_tmpl_args_t *args,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx)
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
{
/*
* Push the resumption point BEFORE pushing the xlat onto
* the parents stack.
*/
- (void) unlang_module_yield(request, resume, signal, rctx);
+ (void) unlang_module_yield(request, resume, signal, sigmask, rctx);
/*
* Push the xlat function
request_t *request, CONF_SECTION *subcs,
rlm_rcode_t default_rcode,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx)
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
{
if (!subcs) {
unlang_stack_t *stack = request->stack;
* Push the resumption point BEFORE adding the subsection
* to the parents stack.
*/
- (void) unlang_module_yield(request, resume, signal, rctx);
+ (void) unlang_module_yield(request, resume, signal, sigmask, rctx);
if (unlang_interpret_push_section(request, subcs,
default_rcode, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_STOP_PROCESSING;
* @param[in] request The current request.
* @param[in] resume Called on unlang_interpret_mark_runnable().
* @param[in] signal Called on unlang_action().
+ * @param[in] sigmask Set of signals to block.
* @param[in] rctx to pass to the callbacks.
* @return
* - UNLANG_ACTION_YIELD.
*/
unlang_action_t unlang_module_yield(request_t *request,
- module_method_t resume, unlang_module_signal_t signal, void *rctx)
+ module_method_t resume, unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
state->rctx = rctx;
state->resume = resume;
state->signal = signal;
+ state->sigmask = sigmask;
/*
* We set the repeatable flag here,
* @param[in] frame current stack frame.
* @param[in] action to signal.
*/
-static void unlang_module_signal(request_t *request, unlang_stack_frame_t *frame, fr_state_signal_t action)
+static void unlang_module_signal(request_t *request, unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_frame_state_module_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_module_t);
unlang_module_t *mc = unlang_generic_to_module(frame->instruction);
caller = request->module;
request->module = mc->instance->name;
safe_lock(mc->instance);
- state->signal(MODULE_CTX(mc->instance->dl_inst, state->thread->data, state->env_data, state->rctx), request, action);
+ if (!(action & state->sigmask)) state->signal(MODULE_CTX(mc->instance->dl_inst, state->thread->data, state->env_data, state->rctx), request, action);
safe_unlock(mc->instance);
request->module = caller;
*/
typedef void (*unlang_module_fd_event_t)(module_ctx_t const *mctx, request_t *request, int fd);
-/** A callback when the request gets a fr_state_signal_t.
+/** A callback when the request gets a fr_signal_t.
*
* A module may call unlang_yeild(), but still need to do something on FR_SIGNAL_DUP. If so, it's
* set here.
* @param[in] request The current request.
* @param[in] action which is signalling the request.
*/
-typedef void (*unlang_module_signal_t)(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action);
+typedef void (*unlang_module_signal_t)(module_ctx_t const *mctx, request_t *request, fr_signal_t action);
int unlang_module_timeout_add(request_t *request, unlang_module_timeout_t callback,
void const *rctx, fr_time_t when);
int unlang_module_set_resume(request_t *request, module_method_t resume);
-unlang_action_t unlang_module_yield_to_subrequest(rlm_rcode_t *p_result, request_t *child,
- module_method_t resume,
- unlang_module_signal_t signal,
- unlang_subrequest_session_t const *session,
- void *rctx);
-
unlang_action_t unlang_module_yield_to_section(rlm_rcode_t *p_result,
request_t *request, CONF_SECTION *subcs,
rlm_rcode_t default_rcode,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx);
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx);
unlang_action_t unlang_module_yield_to_xlat(TALLOC_CTX *ctx, bool *p_success, fr_value_box_list_t *out,
request_t *request, xlat_exp_head_t const *xlat,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx);
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx);
unlang_action_t unlang_module_yield_to_tmpl(TALLOC_CTX *ctx, fr_value_box_list_t *out,
request_t *request, tmpl_t const *vpt,
unlang_tmpl_args_t *args,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx);
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx);
unlang_action_t unlang_module_yield(request_t *request,
module_method_t resume,
- unlang_module_signal_t signal, void *rctx);
+ unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx);
#ifdef __cplusplus
}
* @{
*/
void *rctx; //!< for resume / signal
- module_method_t resume; //!< resumption handler
+ module_method_t resume; //!< resumption handler
unlang_module_signal_t signal; //!< for signal handlers
+ fr_signal_t sigmask; //!< Signals to block.
/** @} */
*
* When a request detaches we need
*/
-static void unlang_parallel_child_signal(request_t *request, fr_state_signal_t action, void *uctx)
+static void unlang_parallel_child_signal(request_t *request, UNUSED fr_signal_t action, void *uctx)
{
unlang_parallel_child_t *child = uctx;
unlang_stack_frame_t *frame;
unlang_parallel_state_t *state;
- if (action != FR_SIGNAL_DETACH) return;
-
frame = frame_current(request->parent);
state = talloc_get_type_abort(frame->state, unlang_parallel_state_t);
NULL,
unlang_parallel_child_done,
unlang_parallel_child_signal,
+ ~FR_SIGNAL_DETACH,
UNLANG_TOP_FRAME,
&state->children[i]) < 0) goto error;
child_frame = frame_current(child);
*
*/
static void unlang_parallel_signal(UNUSED request_t *request,
- unlang_stack_frame_t *frame, fr_state_signal_t action)
+ unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_parallel_state_t *state = talloc_get_type_abort(frame->state, unlang_parallel_state_t);
int i;
*
*/
static void unlang_subrequest_parent_signal(UNUSED request_t *request, unlang_stack_frame_t *frame,
- fr_state_signal_t action)
+ fr_signal_t action)
{
unlang_frame_state_subrequest_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_subrequest_t);
request_t *child = talloc_get_type_abort(state->child, request_t);
* This processes any detach signals the child receives
* The child doesn't actually do the detaching
*/
-static void unlang_subrequest_child_signal(request_t *request, fr_state_signal_t action, UNUSED void *uctx)
+static void unlang_subrequest_child_signal(request_t *request, fr_signal_t action, UNUSED void *uctx)
{
unlang_frame_state_subrequest_t *state;
* Indicate to the parent there's no longer a child
*/
state->child = NULL;
-
+
/*
* Tell the parent to resume
*/
*/
if (unlang_function_push(child, NULL,
unlang_subrequest_child_done,
- unlang_subrequest_child_signal, UNLANG_TOP_FRAME, state) < 0) return -1;
+ unlang_subrequest_child_signal,
+ ~(FR_SIGNAL_DETACH | FR_SIGNAL_CANCEL),
+ UNLANG_TOP_FRAME,
+ state) < 0) return -1;
return_point_set(frame_current(child)); /* Stop return going through the resumption frame */
* @param[in] frame being signalled.
* @param[in] action to signal.
*/
-static void unlang_tmpl_signal(request_t *request, unlang_stack_frame_t *frame, fr_state_signal_t action)
+static void unlang_tmpl_signal(request_t *request, unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_frame_state_tmpl_t *state = talloc_get_type_abort(frame->state,
unlang_frame_state_tmpl_t);
}, \
}
-/** A callback when the request gets a fr_state_signal_t.
+/** A callback when the request gets a fr_signal_t.
*
* A module may call unlang_yeild(), but still need to do something on FR_SIGNAL_DUP. If so, it's
* set here.
* @param[in] request The current request.
* @param[in] action which is signalling the request.
*/
-typedef void (*fr_unlang_tmpl_signal_t)(request_t *request, void *rctx, fr_state_signal_t action);
+typedef void (*fr_unlang_tmpl_signal_t)(request_t *request, void *rctx, fr_signal_t action);
/** A callback for when the request is resumed.
*
* @param[in] action We're being signalled with.
*/
typedef void (*unlang_signal_t)(request_t *request,
- unlang_stack_frame_t *frame, fr_state_signal_t action);
+ unlang_stack_frame_t *frame, fr_signal_t action);
/** Custom callback for dumping information about frame state
*
#define unlang_frame_perf_cleanup(_x)
#endif
-void unlang_frame_signal(request_t *request, fr_state_signal_t action, int limit);
+void unlang_frame_signal(request_t *request, fr_signal_t action, int limit);
typedef struct {
request_t *request;
///< previously took.
xlat_func_t resume; //!< called on resume
xlat_func_signal_t signal; //!< called on signal
+ fr_signal_t sigmask; //!< Signals to block
void *rctx; //!< for resume / signal
bool *success; //!< If set, where to record the result
* @param[in] frame The current stack frame.
* @param[in] action What the request should do (the type of signal).
*/
-static void unlang_xlat_signal(request_t *request, unlang_stack_frame_t *frame, fr_state_signal_t action)
+static void unlang_xlat_signal(request_t *request, unlang_stack_frame_t *frame, fr_signal_t action)
{
unlang_frame_state_xlat_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t);
TALLOC_FREE(state->event_ctx);
}
- if (!state->signal) return;
+ if (!state->signal || (state->sigmask & action)) return;
xlat_signal(state->signal, state->exp, request, state->rctx, action);
}
* @param[in] request The current request.
* @param[in] resume Called on unlang_interpret_mark_runnable().
* @param[in] signal Called on unlang_action().
+ * @param[in] sigmask Signals to block.
* @param[in] rctx to pass to the callbacks.
* @return always returns XLAT_ACTION_YIELD
*/
xlat_action_t unlang_xlat_yield(request_t *request,
- xlat_func_t resume, xlat_func_signal_t signal,
+ xlat_func_t resume, xlat_func_signal_t signal, fr_signal_t sigmask,
void *rctx)
{
unlang_stack_t *stack = request->stack;
*/
state->resume = resume;
state->signal = signal;
+ state->sigmask = sigmask;
state->rctx = rctx;
return XLAT_ACTION_YIELD;
typedef xlat_action_t (*xlat_func_t)(TALLOC_CTX *ctx, fr_dcursor_t *out,
xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in);
-/** A callback when the request gets a fr_state_signal_t.
+/** A callback when the request gets a fr_signal_t.
*
* @note The callback is automatically removed on unlang_interpret_mark_runnable().
*
* @param[in] xctx xlat calling ctx. Contains all instance data.
* @param[in] action which is signalling the request.
*/
-typedef void (*xlat_func_signal_t)(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action);
+typedef void (*xlat_func_signal_t)(xlat_ctx_t const *xctx, request_t *request, fr_signal_t action);
/** Allocate new instance data for an xlat instance
*
CC_HINT(warn_unused_result);
xlat_action_t unlang_xlat_yield(request_t *request,
- xlat_func_t callback, xlat_func_signal_t signal,
+ xlat_func_t callback, xlat_func_signal_t signal, fr_signal_t sigmask,
void *rctx);
/*
}
- if (unlang_xlat_yield(request, xlat_eval_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto error;
+ if (unlang_xlat_yield(request, xlat_eval_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto error;
if (unlang_xlat_push(ctx, &rctx->last_success, (fr_value_box_list_t *)out->dlist,
request, rctx->ex, UNLANG_SUB_FRAME) < 0) goto error;
}
- if (unlang_xlat_yield(request, xlat_eval_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto error;
+ if (unlang_xlat_yield(request, xlat_eval_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto error;
if (unlang_xlat_push(ctx, &rctx->last_success, (fr_value_box_list_t *)out->dlist,
request, rctx->ex, UNLANG_SUB_FRAME) < 0) goto error;
* @param[in] action What the request should do (the type of signal).
*/
void xlat_signal(xlat_func_signal_t signal, xlat_exp_t const *exp,
- request_t *request, void *rctx, fr_state_signal_t action)
+ request_t *request, void *rctx, fr_signal_t action)
{
xlat_thread_inst_t *t = xlat_thread_instance_find(exp);
xlat_debug_log_expansion(request, node, NULL, __LINE__);
- if (unlang_xlat_yield(request, xlat_exec_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto fail;
+ if (unlang_xlat_yield(request, xlat_exec_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto fail;
if (unlang_tmpl_push(ctx, &rctx->list, request, node->vpt,
TMPL_ARGS_EXEC(NULL, fr_time_delta_from_sec(EXEC_TIMEOUT),
MEM(rctx = talloc_zero(unlang_interpret_frame_talloc_ctx(request), xlat_regex_rctx_t));
fr_value_box_list_init(&rctx->list);
- if (unlang_xlat_yield(request, xlat_regex_resume, NULL, rctx) != XLAT_ACTION_YIELD) {
+ if (unlang_xlat_yield(request, xlat_regex_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) {
fail:
talloc_free(rctx);
return XLAT_ACTION_FAIL;
/*
* Push the xlat onto the stack for expansion.
*/
- if (unlang_xlat_yield(request, xlat_logical_resume, NULL, rctx) != XLAT_ACTION_YIELD) {
+ if (unlang_xlat_yield(request, xlat_logical_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) {
fail:
talloc_free(rctx->box);
talloc_free(rctx);
MEM(rctx = talloc_zero(unlang_interpret_frame_talloc_ctx(request), xlat_exists_rctx_t));
fr_value_box_list_init(&rctx->list);
- if (unlang_xlat_yield(request, xlat_exists_resume, NULL, rctx) != XLAT_ACTION_YIELD) {
+ if (unlang_xlat_yield(request, xlat_exists_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) {
fail:
talloc_free(rctx);
return XLAT_ACTION_FAIL;
extern fr_dict_attr_t const *attr_cast_base;
void xlat_signal(xlat_func_signal_t signal, xlat_exp_t const *exp,
- request_t *request, void *rctx, fr_state_signal_t action);
+ request_t *request, void *rctx, fr_signal_t action);
xlat_action_t xlat_frame_eval_resume(TALLOC_CTX *ctx, fr_dcursor_t *out,
xlat_exp_head_t const **child,
goto done;
}
- if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto error;
+ if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto error;
/*
* Push the next child...
*/
case XLAT_REDUNDANT:
rctx->current = rctx->first = xri->ex; /* First element first */
- if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, rctx) != XLAT_ACTION_YIELD) {
+ if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) {
error:
talloc_free(rctx);
return XLAT_ACTION_FAIL;
*/
case XLAT_LOAD_BALANCE:
rctx->first = &xri->ex[(size_t)fr_rand() & (talloc_array_length(xri->ex) - 1)]; /* Random start */
- if (unlang_xlat_yield(request, xlat_load_balance_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto error;
+ if (unlang_xlat_yield(request, xlat_load_balance_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto error;
break;
/*
*/
case XLAT_REDUNDANT_LOAD_BALANCE:
rctx->first = &xri->ex[(size_t)fr_rand() & (talloc_array_length(xri->ex) - 1)]; /* Random start */
- if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, rctx) != XLAT_ACTION_YIELD) goto error;
+ if (unlang_xlat_yield(request, xlat_redundant_resume, NULL, 0, rctx) != XLAT_ACTION_YIELD) goto error;
break;
default:
RETURN_MODULE_OK;
}
-static void mod_delay_cancel(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_delay_cancel(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Cancelling delay");
(void) unlang_module_timeout_delete(request, mctx->rctx);
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_delay_return, mod_delay_cancel, yielded_at);
+ return unlang_module_yield(request, mod_delay_return, mod_delay_cancel, ~FR_SIGNAL_CANCEL, yielded_at);
}
static xlat_action_t xlat_delay_resume(TALLOC_CTX *ctx, fr_dcursor_t *out,
return XLAT_ACTION_DONE;
}
-static void xlat_delay_cancel(UNUSED xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action)
+static void xlat_delay_cancel(UNUSED xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action)
{
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Cancelling delay");
}
return XLAT_ACTION_FAIL;
}
- return unlang_xlat_yield(request, xlat_delay_resume, xlat_delay_cancel, yielded_at);
+ return unlang_xlat_yield(request, xlat_delay_resume, xlat_delay_cancel, ~FR_SIGNAL_CANCEL, yielded_at);
}
static int mod_bootstrap(module_inst_ctx_t const *mctx)
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, dhcpv4_resume, NULL, d);
+ return unlang_module_yield(request, dhcpv4_resume, NULL, 0, d);
}
extern module_rlm_t rlm_dhcpv4;
* @param[in] request The current request.
* @param[in] action to perform.
*/
-static void mod_authenticate_cancel(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_authenticate_cancel(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
eap_session_t *eap_session;
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Request cancelled - Destroying EAP-Session");
eap_session = talloc_get_type_abort(mctx->rctx, eap_session_t);
* done (after the subrequest frame in the
* parent gets popped).
*/
- (void)unlang_module_yield(request, mod_authenticate_result_async, mod_authenticate_cancel, eap_session);
+ (void)unlang_module_yield(request, mod_authenticate_result_async, mod_authenticate_cancel, ~FR_SIGNAL_CANCEL, eap_session);
/*
* This sets up a subrequest frame in the parent
/*
* Setup the resumption frame to process the result
*/
- (void)unlang_module_yield(request, mod_handshake_resume, NULL, eap_session);
+ (void)unlang_module_yield(request, mod_handshake_resume, NULL, 0, eap_session);
/*
* Process TLS layer until done.
RETURN_MODULE_FAIL;
}
- return unlang_module_yield_to_section(p_result, request, unlang, RLM_MODULE_FAIL, gtc_resume, NULL, eap_session);
+ return unlang_module_yield_to_section(p_result, request, unlang, RLM_MODULE_FAIL, gtc_resume, NULL, 0, eap_session);
}
RETURN_MODULE_FAIL;
}
- return unlang_module_yield_to_section(p_result, request, unlang, RLM_MODULE_FAIL, mschap_resume, NULL, eap_session);
+ return unlang_module_yield_to_section(p_result, request, unlang, RLM_MODULE_FAIL, mschap_resume, NULL, 0, eap_session);
}
/*
/*
* Setup the resumption frame to process the result
*/
- (void)unlang_module_yield(request, mod_handshake_resume, NULL, eap_session);
+ (void)unlang_module_yield(request, mod_handshake_resume, NULL, 0, eap_session);
/*
* Process TLS layer until done.
* Result is always OK, even if we fail to persist the
* session data.
*/
- unlang_module_yield(request, mod_handshake_done, NULL, mctx->rctx);
+ unlang_module_yield(request, mod_handshake_done, NULL, 0, mctx->rctx);
/*
* Write the session to the session cache
*
/*
* Setup the resumption frame to process the result
*/
- (void)unlang_module_yield(request, mod_handshake_resume, NULL, eap_session);
+ (void)unlang_module_yield(request, mod_handshake_resume, NULL, 0, eap_session);
/*
* Process TLS layer until done.
/*
* Setup the resumption frame to process the result
*/
- (void)unlang_module_yield(request, mod_handshake_resume, NULL, eap_session);
+ (void)unlang_module_yield(request, mod_handshake_resume, NULL, 0, eap_session);
/*
* Process TLS layer until done.
return XLAT_ACTION_FAIL;
}
- return unlang_xlat_yield(request, exec_xlat_resume, NULL, exec);
+ return unlang_xlat_yield(request, exec_xlat_resume, NULL, 0, exec);
}
/*
fr_value_box_list_init(box);
return unlang_module_yield_to_xlat(request, NULL, box, request, tmpl_xlat(inst->tmpl),
- mod_exec_nowait_resume, NULL, box);
+ mod_exec_nowait_resume, NULL, 0, box);
}
/*
request, inst->tmpl,
TMPL_ARGS_EXEC(env_pairs, inst->timeout, true, &m->status),
mod_exec_wait_resume,
- NULL, &m->box);
+ NULL, 0, &m->box);
}
return XLAT_ACTION_DONE;
}
-static void xlat_icmp_cancel(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action)
+static void xlat_icmp_cancel(xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action)
{
rlm_icmp_echo_t *echo = talloc_get_type_abort(xctx->rctx, rlm_icmp_echo_t);
rlm_icmp_thread_t *t = talloc_get_type_abort(xctx->mctx->thread, rlm_icmp_thread_t);
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Cancelling ICMP request for %pV (counter=%d)", echo->ip, echo->counter);
(void) fr_rb_delete(t->tree, echo);
return XLAT_ACTION_FAIL;
}
- return unlang_xlat_yield(request, xlat_icmp_resume, xlat_icmp_cancel, echo);
+ return unlang_xlat_yield(request, xlat_icmp_resume, xlat_icmp_cancel, ~FR_SIGNAL_CANCEL, echo);
}
static int8_t echo_cmp(void const *one, void const *two)
CONF_PARSER_TERMINATOR
};
-static void imap_io_module_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void imap_io_module_signal(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
fr_curl_io_request_t *randle = talloc_get_type_abort(mctx->rctx, fr_curl_io_request_t);
rlm_imap_thread_t *t = talloc_get_type_abort(mctx->thread, rlm_imap_thread_t);
CURLMcode ret;
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Forcefully cancelling pending IMAP request");
ret = curl_multi_remove_handle(t->mhandle->mandle, randle->candle); /* Gracefully terminate the request */
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_authenticate_resume, imap_io_module_signal, randle);
+ return unlang_module_yield(request, mod_authenticate_resume, imap_io_module_signal, ~FR_SIGNAL_CANCEL, randle);
}
/** Clean up CURL handle on freeing
/** Callback for signalling async ldap query
*
*/
-static void ldap_xlat_signal(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action)
+static void ldap_xlat_signal(xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action)
{
fr_ldap_query_t *query = talloc_get_type_abort(xctx->rctx, fr_ldap_query_t);
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Forcefully cancelling pending LDAP query");
fr_trunk_request_signal_cancel(query->treq);
goto error;
}
- return unlang_xlat_yield(request, ldap_xlat_resume, ldap_xlat_signal, query);
+ return unlang_xlat_yield(request, ldap_xlat_resume, ldap_xlat_signal, ~FR_SIGNAL_CANCEL, query);
}
/*
}
-static void mod_radius_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_radius_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action)
{
rlm_radius_t const *inst = talloc_get_type_abort_const(mctx->inst->data, rlm_radius_t);
rlm_radius_io_t const *io = (rlm_radius_io_t const *)inst->io_submodule->module; /* Public symbol exported by the module */
RETURN_MODULE_RCODE(rcode);
}
- return unlang_module_yield(request, inst->io->resume, mod_radius_signal, rctx);
+ return unlang_module_yield(request, inst->io->resume, mod_radius_signal, 0, rctx);
}
static int mod_bootstrap(module_inst_ctx_t const *mctx)
RETURN_MODULE_RCODE(rcode);
}
-static void mod_signal(module_ctx_t const *mctx, UNUSED request_t *request, fr_state_signal_t action)
+static void mod_signal(module_ctx_t const *mctx, UNUSED request_t *request, fr_signal_t action)
{
udp_thread_t *t = talloc_get_type_abort(mctx->thread, udp_thread_t);
udp_result_t *r = talloc_get_type_abort(mctx->rctx, udp_result_t);
* If we're signalled that the request has been cancelled (FR_SIGNAL_CANCEL).
* Cleanup any pending state and release the connection handle back into the pool.
*/
-void rest_io_module_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+void rest_io_module_signal(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
fr_curl_io_request_t *randle = talloc_get_type_abort(mctx->rctx, fr_curl_io_request_t);
rlm_rest_thread_t *t = talloc_get_type_abort(mctx->thread, rlm_rest_thread_t);
CURLMcode ret;
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Forcefully cancelling pending REST request");
ret = curl_multi_remove_handle(t->mhandle->mandle, randle->candle); /* Gracefully terminate the request */
* If we're signalled that the request has been cancelled (FR_SIGNAL_CANCEL).
* Cleanup any pending state and release the connection handle back into the pool.
*/
-void rest_io_xlat_signal(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action)
+void rest_io_xlat_signal(xlat_ctx_t const *xctx, request_t *request, fr_signal_t action)
{
rlm_rest_t *mod_inst = talloc_get_type_abort(xctx->mctx->inst->data, rlm_rest_t);
rlm_rest_thread_t *t = talloc_get_type_abort(xctx->mctx->thread, rlm_rest_thread_t);
rlm_rest_xlat_rctx_t *our_rctx = talloc_get_type_abort(xctx->rctx, rlm_rest_xlat_rctx_t);
fr_curl_io_request_t *randle = talloc_get_type_abort(our_rctx->handle, fr_curl_io_request_t);
- rest_io_module_signal(MODULE_CTX(dl_module_instance_by_data(mod_inst), t, xctx->mctx->env_data, randle),
- request, action);
+ rest_io_module_signal(MODULE_CTX(dl_module_instance_by_data(mod_inst),
+ t,
+ xctx->mctx->env_data,
+ randle),
+ request,
+ action);
}
/*
* Async IO helpers
*/
-void rest_io_module_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action);
-void rest_io_xlat_signal(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action);
+void rest_io_module_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action);
+void rest_io_xlat_signal(xlat_ctx_t const *xctx, request_t *request, fr_signal_t action);
ret = fr_curl_io_request_enqueue(t->mhandle, request, randle);
if (ret < 0) goto error;
- return unlang_xlat_yield(request, rest_xlat_resume, rest_io_xlat_signal, rctx);
+ return unlang_xlat_yield(request, rest_xlat_resume, rest_io_xlat_signal, ~FR_SIGNAL_CANCEL, rctx);
}
static unlang_action_t mod_authorize_result(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_authorize_result, rest_io_module_signal, handle);
+ return unlang_module_yield(request, mod_authorize_result, rest_io_module_signal, ~FR_SIGNAL_CANCEL, handle);
}
static unlang_action_t mod_authenticate_result(rlm_rcode_t *p_result,
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_authenticate_result, rest_io_module_signal, handle);
+ return unlang_module_yield(request, mod_authenticate_result, rest_io_module_signal, ~FR_SIGNAL_CANCEL, handle);
}
static unlang_action_t mod_accounting_result(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_accounting_result, rest_io_module_signal, handle);
+ return unlang_module_yield(request, mod_accounting_result, rest_io_module_signal, ~FR_SIGNAL_CANCEL, handle);
}
static unlang_action_t mod_post_auth_result(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
RETURN_MODULE_FAIL;
}
- return unlang_module_yield(request, mod_post_auth_result, rest_io_module_signal, handle);
+ return unlang_module_yield(request, mod_post_auth_result, rest_io_module_signal, ~FR_SIGNAL_CANCEL, handle);
}
static int parse_sub_section(rlm_rest_t *inst, CONF_SECTION *parent, CONF_PARSER const *config_items,
return 0;
}
-static void sigtran_client_signal(module_ctx_t const *mctx, UNUSED request_t *request, fr_state_signal_t action)
+static void sigtran_client_signal(module_ctx_t const *mctx, UNUSED request_t *request, UNUSED fr_signal_t action)
{
sigtran_transaction_t *txn = talloc_get_type_abort(mctx->rctx, sigtran_transaction_t);
- /*
- * Ignore DUP signals, along with all others.
- */
- if (action != FR_SIGNAL_CANCEL) return;
-
txn->ctx.defunct = true; /* Mark the transaction up as needing to be freed */
txn->ctx.request = NULL; /* remove the link to the (now dead) request */
}
goto error;
}
- return unlang_module_yield(request, sigtran_client_map_resume, sigtran_client_signal, txn);
+ return unlang_module_yield(request, sigtran_client_map_resume, sigtran_client_signal, ~FR_SIGNAL_CANCEL, txn);
}
return attachments_set;
}
-static void smtp_io_module_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void smtp_io_module_signal(module_ctx_t const *mctx, request_t *request, UNUSED fr_signal_t action)
{
fr_curl_io_request_t *randle = talloc_get_type_abort(mctx->rctx, fr_curl_io_request_t);
rlm_smtp_thread_t *t = talloc_get_type_abort(mctx->thread, rlm_smtp_thread_t);
CURLMcode ret;
- if (action != FR_SIGNAL_CANCEL) return;
-
RDEBUG2("Forcefully cancelling pending SMTP request");
ret = curl_multi_remove_handle(t->mhandle->mandle, randle->candle); /* Gracefully terminate the request */
if (fr_curl_io_request_enqueue(t->mhandle, request, randle)) RETURN_MODULE_INVALID;
- return unlang_module_yield(request, smtp_io_module_resume, smtp_io_module_signal, randle);
+ return unlang_module_yield(request, smtp_io_module_resume, smtp_io_module_signal, ~FR_SIGNAL_CANCEL, randle);
}
/*
if (fr_curl_io_request_enqueue(t->mhandle, request, randle)) RETURN_MODULE_INVALID;
- return unlang_module_yield(request, smtp_io_module_resume, smtp_io_module_signal, randle);
+ return unlang_module_yield(request, smtp_io_module_resume, smtp_io_module_signal, ~FR_SIGNAL_CANCEL, randle);
}
static int mod_bootstrap(module_inst_ctx_t const *mctx)
return 0;
}
-static void mod_tacacs_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_tacacs_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action)
{
rlm_tacacs_t const *inst = talloc_get_type_abort_const(mctx->inst->data, rlm_tacacs_t);
rlm_tacacs_io_t const *io = (rlm_tacacs_io_t const *)inst->io_submodule->module; /* Public symbol exported by the module */
RETURN_MODULE_RCODE(rcode);
}
- return unlang_module_yield(request, inst->io->resume, mod_tacacs_signal, rctx);
+ return unlang_module_yield(request, inst->io->resume, mod_tacacs_signal, 0, rctx);
}
static int mod_bootstrap(module_inst_ctx_t const *mctx)
RETURN_MODULE_RCODE(rcode);
}
-static void mod_signal(module_ctx_t const *mctx, UNUSED request_t *request, fr_state_signal_t action)
+static void mod_signal(module_ctx_t const *mctx, UNUSED request_t *request, fr_signal_t action)
{
// udp_thread_t *t = talloc_get_type_abort(mctx->thread, udp_thread_t);
udp_result_t *r = talloc_get_type_abort(mctx->rctx, udp_result_t);
RETURN_MODULE_OK;
}
-static void mod_retry_signal(module_ctx_t const *mctx, request_t *request, fr_state_signal_t action);
+static void mod_retry_signal(module_ctx_t const *mctx, request_t *request, fr_signal_t action);
/** Continue after marked runnable
*
{
RDEBUG("Test retry");
- return unlang_module_yield(request, mod_retry_resume, mod_retry_signal, NULL);
+ return unlang_module_yield(request, mod_retry_resume, mod_retry_signal, 0, NULL);
}
/** Continue after FR_SIGNAL_TIMEOUT
RETURN_MODULE_OK;
}
-static void mod_retry_signal(UNUSED module_ctx_t const *mctx, request_t *request, fr_state_signal_t action)
+static void mod_retry_signal(UNUSED module_ctx_t const *mctx, request_t *request, fr_signal_t action)
{
switch (action) {
case FR_SIGNAL_RETRY:
*/
static unlang_action_t CC_HINT(nonnull) mod_retry(UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, request_t *request)
{
- return unlang_module_yield(request, mod_retry_resume, mod_retry_signal, NULL);
+ return unlang_module_yield(request, mod_retry_resume, mod_retry_signal, 0, NULL);
}
/*
* Xlat signal callback if an unbound request needs cancelling
*/
-static void xlat_unbound_signal(xlat_ctx_t const *xctx, request_t *request, fr_state_signal_t action)
+static void xlat_unbound_signal(xlat_ctx_t const *xctx, request_t *request, UNUSED fr_signal_t action)
{
unbound_request_t *ur = talloc_get_type_abort(xctx->rctx, unbound_request_t);
- if (action != FR_SIGNAL_CANCEL) return;
-
if (ur->ev) (void)fr_event_timer_delete(&ur->ev);
RDEBUG2("Forcefully cancelling pending unbound request");
return XLAT_ACTION_FAIL;
}
- return unlang_xlat_yield(request, xlat_unbound_resume, xlat_unbound_signal, ur);
+ return unlang_xlat_yield(request, xlat_unbound_resume, xlat_unbound_signal, ~FR_SIGNAL_CANCEL, ur);
}
static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->resume,
- NULL, rctx);
+ NULL, 0, rctx);
}
/** Validate a request/renew/decline/release
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->resume,
- NULL, rctx);
+ NULL, 0, rctx);
}
/** Copy a reply pair back into the response
return unlang_module_yield_to_section(p_result, request,
cs, state->rcode, state->resume,
- NULL, rctx);
+ NULL, 0, rctx);
}
/** Restore our copy of the header fields into the reply list
RDEBUG("Running 'authenticate %s' from file %s", cf_section_name2(cs), cf_filename(cs));
return unlang_module_yield_to_section(p_result, request,
cs, RLM_MODULE_NOOP, resume_auth_type,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME(auth_type)
*/
return unlang_module_yield_to_section(p_result, request,
cs, RLM_MODULE_NOOP, resume_acct_type,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
#if 0
RDEBUG("Running 'authenticate %s' from file %s", cf_section_name2(cs), cf_filename(cs));
return unlang_module_yield_to_section(p_result, request,
cs, RLM_MODULE_NOOP, resume_auth_type,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME(auth_type)
*/
return unlang_module_yield_to_section(p_result, request,
cs, RLM_MODULE_NOOP, resume_acct_type,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
RDEBUG("Running 'authenticate %s' from file %s", cf_section_name2(cs), cf_filename(cs));
return unlang_module_yield_to_section(p_result, request,
cs, RLM_MODULE_NOOP, resume_auth_type,
- NULL, mctx->rctx);
+ NULL, 0, mctx->rctx);
}
RESUME(auth_type)