From: Alan T. DeKok Date: Fri, 19 Mar 2021 12:46:39 +0000 (-0400) Subject: add temp unlang_virtual_server_push() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=894366e9d6f226f5032f4e15f6cc43f50d444d74;p=thirdparty%2Ffreeradius-server.git add temp unlang_virtual_server_push() --- diff --git a/src/lib/unlang/call.c b/src/lib/unlang/call.c index 73ae1237316..b9ff27b9215 100644 --- a/src/lib/unlang/call.c +++ b/src/lib/unlang/call.c @@ -214,6 +214,27 @@ int unlang_call_push(request_t *request, CONF_SECTION *server_cs, return 0; } +/* + * Hacks for now until we do cleanups. + * + * This function should really do the module_instance_t + * initialization, which is currently in + * virtual_server_entry_point_set(). The interpreter needs the + * top stack frame to contain a unlang_frame_state_module_t, in + * order to properly do resume, etc. with the module context, + * dl_inst->data, etc. + * + * We still want the cf_data_find() stuff in the virtual server + * code, as it's responsible for adding / finding the link + * between process functions. + */ +int unlang_virtual_server_push(request_t *request, CONF_SECTION *server_cs) +{ + request->server_cs = server_cs; /* probably wrong, but what the heck */ + virtual_server_entry_point_set(request); + + return 0; +} void unlang_call_init(void) { diff --git a/src/lib/unlang/call.h b/src/lib/unlang/call.h index 7bf4c734202..94ef7181966 100644 --- a/src/lib/unlang/call.h +++ b/src/lib/unlang/call.h @@ -32,6 +32,8 @@ int unlang_call_push(request_t *request, CONF_SECTION *server_cs, void *instance, module_method_t entry_point, bool top_frame) CC_HINT(warn_unused_result); +int unlang_virtual_server_push(request_t *request, CONF_SECTION *server_cs); + #ifdef __cplusplus } #endif