You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2017/08/08 11:44:26 UTC

svn commit: r1804403 - in /tcl/rivet/branches/2.3: ChangeLog configure.ac src/apache-2/mod_rivet.c

Author: mxmanghi
Date: Tue Aug  8 11:44:26 2017
New Revision: 1804403

URL: http://svn.apache.org/viewvc?rev=1804403&view=rev
Log:
    * src/apache-2/mod_rivet.c: implementing check on post_config
    hook calling Rivet_InitHandler. This avoids the module
    initialization to run twice but only on the second time
    the hook is called
    * configure.ac: bumping version number to 2.3.5


Modified:
    tcl/rivet/branches/2.3/ChangeLog
    tcl/rivet/branches/2.3/configure.ac
    tcl/rivet/branches/2.3/src/apache-2/mod_rivet.c

Modified: tcl/rivet/branches/2.3/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/ChangeLog?rev=1804403&r1=1804402&r2=1804403&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/ChangeLog (original)
+++ tcl/rivet/branches/2.3/ChangeLog Tue Aug  8 11:44:26 2017
@@ -1,3 +1,13 @@
+2017-08-08 Massimo Manghi <mx...@apache.org>
+    * src/apache-2/mod_rivet.c: implementing check on post_config
+    hook calling Rivet_InitHandler. This avoids the module
+    initialization to run twice but only on the second time
+    the hook is called
+    * configure.ac: bumping version number to 2.3.5
+
+2017-08-03 Massimo Manghi <mx...@apache.org>
+    * .: releasing as 2.3.4
+
 2017-07-27 Massimo Manghi <mx...@apache.org>
     * src/librivet/rivetWWW.c: Doubling the size of chunks 
     allocated for the buffer in Rivet_EscapeSgmlCharsCmd (6 chars) 

Modified: tcl/rivet/branches/2.3/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/configure.ac?rev=1804403&r1=1804402&r2=1804403&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/configure.ac (original)
+++ tcl/rivet/branches/2.3/configure.ac Tue Aug  8 11:44:26 2017
@@ -22,7 +22,7 @@ dnl
 # so you can encode the package version directly into the source files.
 #-----------------------------------------------------------------------
 
-AC_INIT([Rivet],[2.3.4])
+AC_INIT([Rivet],[2.3.5])
 TEA_INIT([3.9])
 
 # we are storing here the configure command line, as recursive

Modified: tcl/rivet/branches/2.3/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.3/src/apache-2/mod_rivet.c?rev=1804403&r1=1804402&r2=1804403&view=diff
==============================================================================
--- tcl/rivet/branches/2.3/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/2.3/src/apache-2/mod_rivet.c Tue Aug  8 11:44:26 2017
@@ -39,7 +39,6 @@
 #include <http_log.h>
 #include <http_main.h>
 #include <util_script.h>
-//#include "http_conf_globals.h"
 #include <http_config.h>
 
 #include <apr_pools.h>
@@ -983,10 +982,30 @@ Rivet_PerInterpInit(server_rec *s, rivet
 static int
 Rivet_InitHandler(apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s)
 {
+	void*				userdata;
+	const char 			*userdata_key = "rivet_post_config";
     rivet_server_conf *rsc = RIVET_SERVER_CONF( s->module_config );
     rivet_panic_pool       = pPool;
     rivet_panic_server_rec = s;
 
+	/* This function runs as post_config_hook
+	 * and as such it's run twice by design. 
+	 * This is the recommended way to avoid a double load of
+	 * external modules.
+	 */
+
+	apr_pool_userdata_get(&userdata, userdata_key, s->process->pool);
+	if (userdata == NULL)
+	{
+		apr_pool_userdata_set((const void *)1, userdata_key,
+                              apr_pool_cleanup_null, s->process->pool);
+
+        ap_log_error(APLOG_MARK,APLOG_INFO,0,s,
+                     "first post_config run: not initializing Tcl stuff");
+
+        return OK; /* This would be the first time through */
+	}
+
     rivet_module_globals = apr_pcalloc(pPool,sizeof(mod_rivet_globals));
     rivet_module_globals->rsc_p = rsc;
 #if RIVET_DISPLAY_VERSION



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org