/*
* Set the entry point for this virtual server.
*/
- virtual_server_entry_point_set(request);
- if (!request->async->process) {
+ if (virtual_server_entry_point_set(request) < 0) {
RERROR("Protocol failed to set 'process' function");
worker_nak(worker, cd, now);
return;
return 0;
}
-static unlang_action_t null_method(UNUSED rlm_rcode_t *p_result, UNUSED module_ctx_t const *mctx, UNUSED request_t *request)
-{
- RETURN_MODULE_OK;
-}
-
-
/** Set the request processing function.
*
* Short-term hack
*/
-void virtual_server_entry_point_set(request_t *request)
+int virtual_server_entry_point_set(request_t *request)
{
fr_virtual_server_t *server;
fr_process_module_t const *process;
module_instance_t *mi = talloc_zero(request, module_instance_t);
server = cf_data_value(cf_data_find(request->server_cs, fr_virtual_server_t, "vs"));
- if (!server) return;
+ if (!server) return -1;
mi->name = server->process_module->name;
if (unlikely(track && track->dynamic && server->dynamic_client_module)) {
process = (fr_process_module_t const *) server->dynamic_client_module->module->common;
- request->async->process = process->process;
- request->async->process_inst = server->dynamic_client_module->data;
mi->dl_inst = server->dynamic_client_module;
} else {
process = (fr_process_module_t const *) server->process_module->module->common;
- request->async->process = process->process;
- request->async->process_inst = server->process_module->data;
mi->dl_inst = server->process_module;
}
* src/lib/server/module.c, that reserves 0 for "nothing
* is initialized".
*/
- if (unlang_module_push(&request->rcode, request, mi, null_method, true) < 0) {
- fr_assert(0);
- }
+ if (unlang_module_push(&request->rcode, request, mi, process->process, true) < 0) return -1;
+
+ return 0;
}
/** Allow dynamic clients in this virtual server.
int virtual_server_get_process_by_name(CONF_SECTION *server, char const *type, module_method_t *method_p, void **ctx);
-void virtual_server_entry_point_set(request_t *request);
+int virtual_server_entry_point_set(request_t *request);
int virtual_server_dynamic_clients_allow(CONF_SECTION *server_cs);