You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2026/07/11 14:57:50 UTC
(tcl-rivet) 02/02: Explicit scoping array 'server' in the global namespace
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 6f02bd157fe1ef7a40a6bb39c383a71513ff0c3f
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sat Jul 11 16:57:42 2026 +0200
Explicit scoping array 'server' in the global namespace
---
ChangeLog | 15 ++++++++++-----
src/mod_rivet_ng/mod_rivet_common.c | 23 +++++++++++------------
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e32ee9d..42ae141 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-07-11 Massimo Manghi <mx...@apache.org>
+ * src/mod_rivet_ng/mod_rivet_common.c: Now explicitly scoping in the
+ global namespace the array 'server' that ships some information about
+ mod_rivet (legacy array inherited from early versions for Apache 1.x).
+ This is needed by the change introduced by Tcl9 in the variable name
+ resolution mechanism that doesn't lookup in the global namespace anymore
+
2026-07-03 Massimo Manghi <mx...@apache.org>
* src/mod_rivet_ng/rivetCore.c: implement 1st class C level commands
::rivet::write_binary and ::rivet::with_binary_output for consistent
@@ -15,7 +22,7 @@
* tests/get.rvt: Convert internationalized variable names to UTF-8.
* tests/headers.test: Update expected request headers for the bundled HTTP client.
* tests/hello.rvt: Convert internationalized Spanish and Japanese text to UTF-8.
- * tests/hello.test: Convert internationalized expectations to UTF-8.
+ * tests/hello.test: Convert internationalized expected values to UTF-8.
* tests/include.html: Convert the Japanese include fixture to UTF-8.
* tests/include.test: Update the UTF-8 include expectation and emitted whitespace.
* tests/inspect.test: Make ChildInitScript inspection checks robust
@@ -34,8 +41,7 @@
Rivet child interpreters, replacing the obsolete UTF-8 warning.
* tests/tclfile.tcl: Convert the plain Tcl internationalized fixture to UTF-8.
* tests/tclfile.test: Convert the plain Tcl file expectation to UTF-8.
- * doc/xml/commands.xml: Document the ::rivet::parse -encoding, -virtual
- and -string forms.
+ * doc/xml/commands.xml: Document the ::rivet::parse -encoding, -virtual and -string forms.
2026-04-19 Massimo Manghi <mx...@apache.org>
* rivet/packages/dio/dio_Tdbc.tcl: trimming sql command string before
@@ -44,8 +50,7 @@
2026-03-10 Massimo Manghi <mx...@apache.org>
* src/mod_rivet_ng/rivet_[worker|prefork|lazy]_mpm.c: Fully expressing
fields in bridge structure definition
- * src/mod_rivet_ng/mod_rivet_common.c: Reformat lines defining the
- 'server' array
+ * src/mod_rivet_ng/mod_rivet_common.c: Reformat lines defining the 'server' array
* src/mod_rivet_ng/worker_prefork_common.c: Possible memory leak fixed
in Rivet_ProcessorCleanup
diff --git a/src/mod_rivet_ng/mod_rivet_common.c b/src/mod_rivet_ng/mod_rivet_common.c
index 215054c..00c963e 100644
--- a/src/mod_rivet_ng/mod_rivet_common.c
+++ b/src/mod_rivet_ng/mod_rivet_common.c
@@ -237,8 +237,7 @@ void Rivet_ReleasePerDirScripts(rivet_thread_interp* rivet_interp)
*/
void Rivet_PerInterpInit(rivet_thread_interp* interp_obj,
rivet_thread_private* private,
- server_rec *s,
- apr_pool_t *p)
+ server_rec *s, apr_pool_t *p)
{
rivet_interp_globals* globals = NULL;
Tcl_Obj* auto_path = NULL;
@@ -669,35 +668,35 @@ void Rivet_CleanupRequest( request_rec *r )
*
*/
-void Rivet_InitServerVariables( Tcl_Interp *interp, apr_pool_t *pool )
+void Rivet_InitServerVariables (Tcl_Interp *interp, apr_pool_t *pool)
{
int ap_mpm_result;
Tcl_Obj *obj;
obj = Tcl_NewStringObj(ap_server_root, -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","SERVER_ROOT",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","SERVER_ROOT",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
obj = Tcl_NewStringObj(ap_server_root_relative(pool,SERVER_CONFIG_FILE), -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","SERVER_CONF",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","SERVER_CONF",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
obj = Tcl_NewStringObj(ap_server_root_relative(pool, RIVET_DIR), -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","RIVET_DIR",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","RIVET_DIR",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
obj = Tcl_NewStringObj(ap_server_root_relative(pool, RIVET_INIT), -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","RIVET_INIT",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","RIVET_INIT",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
#if RIVET_DISPLAY_VERSION
obj = Tcl_NewStringObj(RIVET_VERSION, -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","RIVET_VERSION",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","RIVET_VERSION",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
#endif
@@ -716,7 +715,7 @@ void Rivet_InitServerVariables( Tcl_Interp *interp, apr_pool_t *pool )
break;
}
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","MPM_THREADED",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","MPM_THREADED",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
}
@@ -735,18 +734,18 @@ void Rivet_InitServerVariables( Tcl_Interp *interp, apr_pool_t *pool )
break;
}
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","MPM_FORKED",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","MPM_FORKED",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
}
obj = Tcl_NewStringObj(module_globals->rivet_mpm_bridge, -1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","RIVET_MPM_BRIDGE",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","RIVET_MPM_BRIDGE",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
obj = Tcl_NewStringObj(RIVET_CONFIGURE_CMD,-1);
Tcl_IncrRefCount(obj);
- Tcl_SetVar2Ex(interp,"server","RIVET_CONFIGURE_CMD",obj,TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp,"::server","RIVET_CONFIGURE_CMD",obj,TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(obj);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org