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/11 00:26:25 UTC

svn commit: r1804745 - in /tcl/rivet/branches/cmake: ChangeLog src/mod_rivet_ng/mod_rivet.c

Author: mxmanghi
Date: Fri Aug 11 00:26:25 2017
New Revision: 1804745

URL: http://svn.apache.org/viewvc?rev=1804745&view=rev
Log:
add check on AP_PARENT_PID env variable

Modified:
    tcl/rivet/branches/cmake/ChangeLog
    tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c

Modified: tcl/rivet/branches/cmake/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/ChangeLog?rev=1804745&r1=1804744&r2=1804745&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/ChangeLog (original)
+++ tcl/rivet/branches/cmake/ChangeLog Fri Aug 11 00:26:25 2017
@@ -1,3 +1,10 @@
+2017-08-11 Massimo Manghi <mx...@apache.org>
+	* src/mod_rivet_ng/mod_rivet.c: add check on 
+	environment variable AP_PARENT_PID to prevent
+	server Tcl init script from running in winnt
+	controlled child processes (as per Apache HTTP 
+	server documentation)
+	
 2017-08-10 Georgios Petasis <pe...@apache.org>
     * src\mod_rivet_ng\apache_config.c:
     * src\mod_rivet_ng\mod_rivet.c:

Modified: tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c?rev=1804745&r1=1804744&r2=1804745&view=diff
==============================================================================
--- tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c (original)
+++ tcl/rivet/branches/cmake/src/mod_rivet_ng/mod_rivet.c Fri Aug 11 00:26:25 2017
@@ -218,6 +218,7 @@ int Rivet_Exit_Handler(int code)
 static int
 Rivet_RunServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s)
 {
+	char*			   parent_pid_var = NULL;
     rivet_server_conf* rsc = RIVET_SERVER_CONF( s->module_config );
 
     FILEDEBUGINFO;
@@ -231,6 +232,21 @@ Rivet_RunServerInit (apr_pool_t *pPool,
 
     Rivet_PerInterpInit(module_globals->server_interp,NULL,s,pPool);
 
+	/* if the environment variable AP_PARENT_PID is set 
+     * we know we are in a child process of the winnt MPM
+     */
+	
+	apr_env_get(&parent_pid_var,"AP_PARENT_PID",pTemp);
+	if (parent_pid_var != NULL)
+	{
+		ap_log_error(APLOG_MARK,APLOG_INFO,0,s,
+					"AP_PARENT_PID found: not running the Tcl server script in winnt MPM child process");
+		return OK;
+	} else {
+		ap_log_error(APLOG_MARK,APLOG_INFO,0,s,
+				 "AP_PARENT_PID undefined, we proceed with server initialization");
+	}
+
     /* We don't create the cache here: it would make sense for prefork MPM
      * but threaded MPM bridges have their pool of threads. Each of them
      * will by now have their own cache
@@ -297,7 +313,7 @@ Rivet_ServerInit (apr_pool_t *pPool, apr
 
         return OK; /* This would be the first time through */
 	}	
-
+	
     /* Everything revolves around this structure: module_globals */
 
     /* the module global structure is allocated and the MPM bridge name established */
@@ -345,7 +361,7 @@ Rivet_ServerInit (apr_pool_t *pPool, apr
         ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, 
                      MODNAME " Error loading MPM manager: %s", 
                      apr_dso_error(dso_handle,errorbuf,ERRORBUF_SZ));
-        exit(1);   
+        exit(1);
     }
 
     Rivet_RunServerInit(pPool,pLog,pTemp,server);



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