int unlang_event_fd_delete(REQUEST *request, void const *ctx, int fd);
-rlm_rcode_t module_unlang_push_function(REQUEST *request,
- unlang_function_t func,
- unlang_function_t repeat,
- fr_module_unlang_resume_t resume,
- fr_module_unlang_signal_t signal, void *rctx);
-
rlm_rcode_t module_unlang_push_xlat(TALLOC_CTX *ctx, fr_value_box_t **out,
REQUEST *request, xlat_exp_t const *xlat,
fr_module_unlang_resume_t callback,
}
}
-/** Push a function onto the stack for execution and a resumption function to call after it completes
- *
- * @param[in] request The current request.
- * @param[in] func to call.
- * @param[in] resume function to call when the function we pushed is complete.
- * @param[in] signal function to call if a signal is received.
- * @param[in] rctx to pass to the pushed function and resume()/signal() callbacks.
- * @return
- * - RLM_MODULE_YIELD.
- */
-rlm_rcode_t module_unlang_push_function(REQUEST *request,
- unlang_function_t func, unlang_function_t repeat,
- fr_module_unlang_resume_t resume,
- fr_module_unlang_signal_t signal, void *rctx)
-{
- /*
- * Push the resumption point
- */
- (void) unlang_module_yield(request, resume, signal, rctx);
-
- unlang_push_function(request, func, repeat, rctx);
-
- return RLM_MODULE_YIELD; /* This may allow us to do optimisations in future */
-}
-
/** Push a pre-compiled xlat and resumption state onto the stack for evaluation
*
* In order to use the async unlang processor the calling module needs to establish
eap_fail(eap_session);
eap_session_destroy(&eap_session);
- return RLM_MODULE_INVALID;
+ rcode = RLM_MODULE_INVALID;
+ goto finish;
}
/*
*/
eap_session_freeze(&eap_session);
+finish:
+ talloc_free(rctx); /* Free rctx */
return rcode;
}
rctx->eap_session = eap_session;
rctx->rcode = RLM_MODULE_UNKNOWN;
- request->module = method->submodule->name;
- return module_unlang_push_function(request, eap_call_submodule, eap_call_submodule,
- mod_authenticate_result, NULL, rctx);
+ /*
+ * mod_authenticate_result will be called after
+ * eap_call_submodule finishes.
+ */
+ unlang_module_yield(request, mod_authenticate_result, NULL, rctx);
+ unlang_push_function(request, eap_call_submodule, eap_call_submodule, rctx);
+
+ return RLM_MODULE_YIELD;
}
static rlm_rcode_t mod_authenticate(void *instance, UNUSED void *thread, REQUEST *request)