]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add temp unlang_virtual_server_push()
authorAlan T. DeKok <aland@freeradius.org>
Fri, 19 Mar 2021 12:46:39 +0000 (08:46 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Mar 2021 15:04:13 +0000 (16:04 +0100)
src/lib/unlang/call.c
src/lib/unlang/call.h

index 73ae1237316b56f7f777d79a287f6249c7f67501..b9ff27b9215c21d12bd4417964998b7252711d55 100644 (file)
@@ -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)
 {
index 7bf4c7342022e4443bd1e6bd1d2f7a235e942bbc..94ef71819669ff391fd7bfa6b13f0d1fbb1a294b 100644 (file)
@@ -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