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 2016/12/05 22:37:06 UTC

svn commit: r1772810 - in /tcl/rivet/trunk: ChangeLog rivet/packages/session/session-class.tcl src/mod_rivet_ng/mod_rivet_common.c src/mod_rivet_ng/rivet_lazy_mpm.c src/mod_rivet_ng/worker_prefork_common.c

Author: mxmanghi
Date: Mon Dec  5 22:37:06 2016
New Revision: 1772810

URL: http://svn.apache.org/viewvc?rev=1772810&view=rev
Log:
    * rivet/packages/session/session-class.tcl: new
    method synch saves in the session cache data
    coming from form
    * src/mod_rivet_ng/mod_rivet_common.c: more
    careful design assign to a single function
    the task of determining the current configuration
    when an interpreter is initialized


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/rivet/packages/session/session-class.tcl
    tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
    tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c
    tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1772810&r1=1772809&r2=1772810&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Dec  5 22:37:06 2016
@@ -1,3 +1,12 @@
+2016-12-05 Massimo Manghi <mx...@apache.org>
+    * rivet/packages/session/session-class.tcl: new
+    method synch saves in the session cache data
+    coming from form
+    * src/mod_rivet_ng/mod_rivet_common.c: more
+    careful design assign to a single function
+    the task of determining the current configuration
+    when an interpreter is initialized
+
 2016-11-30 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivet_lazy_mpm.c:
     * src/mod_rivet_ng/worker_prefork_mpm.c: setting

Modified: tcl/rivet/trunk/rivet/packages/session/session-class.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/session/session-class.tcl?rev=1772810&r1=1772809&r2=1772810&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/session/session-class.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/session/session-class.tcl Mon Dec  5 22:37:06 2016
@@ -106,7 +106,7 @@ package require Itcl
     constructor {args} {
 	eval configure $args
     	$dioObject registerSpecialField $sessionTable session_update_time NOW
-	$dioObject registerSpecialField $sessionTable session_start_time NOW
+	    $dioObject registerSpecialField $sessionTable session_start_time NOW
     }
 
     method status {args} {
@@ -347,13 +347,30 @@ package require Itcl
     }
 
     #
+    # stash -
+    #
+    #
+
+    method stash {packageName keyvalue_d} {
+
+        dict for {key value} $keyvalue_d {
+
+            $this store $packageName $key $value
+
+        }
+
+    }
+
+
+    #
     # load - given a package names returns a dictionary storing the key - value pairs for this session
     #
     #
     method load {packageName} {
         set package_d [dict create]
         
-        $dioObject forall "select key_,data from $sessionCacheTable where package_='$packageName' and session_id='[$this id]'" a {
+        $dioObject forall \
+        "select key_,data from $sessionCacheTable where package_='$packageName' and session_id='[$this id]'" a {
             dict set package_d $a(key_) $a(data)
         }
 

Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c?rev=1772810&r1=1772809&r2=1772810&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c Mon Dec  5 22:37:06 2016
@@ -174,6 +174,16 @@ void Rivet_PerInterpInit(rivet_thread_in
 
     Tcl_DecrRefCount(rivet_tcl);
 
+    /* If the thread has private data we stuff the server conf
+     * pointer in the 'running_conf' field.
+     * Commands running ouside the request processing know how to
+     * get the configuration from the initialization context 
+     * (e.g. ::rivet::inspect). If private is null they get the
+     * server configuration from module_globals->server
+     */
+
+    if (private != NULL) private->running_conf = RIVET_SERVER_CONF (s->module_config);
+
     /* Initialize the interpreter with Rivet's Tcl commands. */
     Rivet_InitCore(interp,private);
 

Modified: tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c?rev=1772810&r1=1772809&r2=1772810&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/rivet_lazy_mpm.c Mon Dec  5 22:37:06 2016
@@ -148,12 +148,6 @@ static void* APR_THREAD_FUNC request_pro
 
     private = Rivet_ExecutionThreadInit();
 
-    /* at thread initialization the running conf is determined by the context
-     * of exectution. The lazy bridge threads are associated to a single virtual.
-     * host. We let the interpreter inizialization run with its configuration
-     * stored in the running_conf field */ 
-
-    private->running_conf = rsc;
     private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific));
     private->ext->keep_going = 1;
     private->ext->interp = Rivet_NewVHostInterp(private->pool,w->server);
@@ -163,7 +157,7 @@ static void* APR_THREAD_FUNC request_pro
     private->ext->interp->scripts = 
             Rivet_RunningScripts (private->pool,private->ext->interp->scripts,rsc);
 
-    Rivet_PerInterpInit(private->ext->interp,private,module_globals->server,private->pool);
+    Rivet_PerInterpInit(private->ext->interp,private,w->server,private->pool);
     
     Lazy_RunConfScript(private,w,child_init);
 

Modified: tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c?rev=1772810&r1=1772809&r2=1772810&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c Mon Dec  5 22:37:06 2016
@@ -179,14 +179,6 @@ rivet_thread_private* Rivet_VirtualHosts
 
         private->ext->interps[myrsc->idx] = rivet_interp;
 
-        /* Let's fetch the virtual host configuration and stuff 
-         * its pointer in the running_conf field of the private data.
-         * Commands running in the initialization context know how to get 
-         * the configuation from it (e.g. ::rivet::inspect)
-         */
-
-        private->running_conf = myrsc;
-
         /* Basic Rivet packages and libraries are loaded here */
 
         if ((rivet_interp->flags & RIVET_INTERP_INITIALIZED) == 0)



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