Determining the server_rec also for server initialization scripts
diff --git a/ChangeLog b/ChangeLog
index 9eca5c2..e25d280 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-04-12 Massimo Manghi <mxmanghi@apache.org>
+ * src/mod_rivet_ng/mod_rivet_common.c: Determining the server_rec also
+ for ServerInitScripts.
+
2024-02-18 Massimo Manghi <mxmanghi@apache.org>
* doc/xml/commands.xml: fixed misspelled command ::rivet::thread_id
* VERSION: new version 3.2.5
diff --git a/src/mod_rivet_ng/mod_rivet_common.c b/src/mod_rivet_ng/mod_rivet_common.c
index c11131b..a742631 100644
--- a/src/mod_rivet_ng/mod_rivet_common.c
+++ b/src/mod_rivet_ng/mod_rivet_common.c
@@ -246,7 +246,13 @@
/* Set up interpreter associated data */
globals = ckalloc(sizeof(rivet_interp_globals));
- Tcl_SetAssocData (interp,"rivet",NULL,globals);
+
+ /*
+ * we assign a default server_rec value into the globals
+ * even though some mpm bridge may override it
+ */
+
+ globals->server = s;
/*
* we store in the globals some information relevant to
@@ -258,6 +264,10 @@
globals->rivet_ns = Tcl_CreateNamespace (interp,RIVET_NS,NULL,
(Tcl_NamespaceDeleteProc *)NULL);
+ /* this is interp specific global data */
+
+ Tcl_SetAssocData (interp,"rivet",NULL,globals);
+
/* We put in front the auto_path list the path to the directory where
* init.tcl is located (provides package Rivet, previously RivetTcl)
*/