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 2019/01/28 12:18:56 UTC

[tcl-rivet] branch master updated: removing unused code and adding comment as a reminder for a consistent interpreter deletion

This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git


The following commit(s) were added to refs/heads/master by this push:
     new 5aa59dc  removing unused code and adding comment as a reminder for a consistent interpreter deletion
5aa59dc is described below

commit 5aa59dcd0effadda60fa714cccfa582f88161d2b
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Jan 28 13:18:40 2019 +0100

    removing unused code and adding comment as a reminder for a consistent interpreter deletion
---
 src/mod_rivet_ng/mod_rivet_generator.c   | 33 +++-----------------------------
 src/mod_rivet_ng/worker_prefork_common.c |  7 +++++++
 2 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/src/mod_rivet_ng/mod_rivet_generator.c b/src/mod_rivet_ng/mod_rivet_generator.c
index 8983aab..d11d57b 100644
--- a/src/mod_rivet_ng/mod_rivet_generator.c
+++ b/src/mod_rivet_ng/mod_rivet_generator.c
@@ -183,7 +183,7 @@ Rivet_SendContent(rivet_thread_private *private,request_rec* r)
 
         if (USER_CONF_UPDATED(rdc))
         {
-            rivet_server_conf*  newconfig   = NULL;
+            rivet_server_conf* newconfig = NULL;
             private->running = (running_scripts *) apr_pcalloc (private->pool,sizeof(running_scripts));
 
             newconfig = RIVET_NEW_CONF(private->r->pool);
@@ -193,7 +193,6 @@ Rivet_SendContent(rivet_thread_private *private,request_rec* r)
             private->running_conf = newconfig;
 
             private->running = Rivet_RunningScripts(private->r->pool,private->running,newconfig);
-
         }
     }
     else
@@ -263,20 +262,6 @@ Rivet_SendContent(rivet_thread_private *private,request_rec* r)
         goto sendcleanup;
     }
 
-    /*
-    if (Tcl_EvalObjEx(interp, private->request_init, 0) == TCL_ERROR)
-    {
-        request_rec* r = private->r;
-
-        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server,
-                            MODNAME ": Could not create request namespace (%s)\n" ,
-                            Tcl_GetStringResult(interp));
-
-        retval = HTTP_INTERNAL_SERVER_ERROR;
-        goto sendcleanup;
-    }
-    */
-
     /* Apache Request stuff */
 
     TclWeb_InitRequest(private, interp);
@@ -315,8 +300,6 @@ Rivet_SendContent(rivet_thread_private *private,request_rec* r)
     /* URL referenced script execution and exception handling */
 
     if (Tcl_EvalObjEx(interp, private->running->request_processing,0) == TCL_ERROR) 
-    //if (Rivet_ParseExecFile (private, private->r->filename, 1) != TCL_OK)
-    //if (Rivet_ExecuteAndCheck(private,private->request_processing) == TCL_ERROR)
     {
         /* we don't report errors coming from abort_page execution */
 
@@ -338,18 +321,8 @@ Rivet_SendContent(rivet_thread_private *private,request_rec* r)
         private->running_conf->user_scripts_status &= ~(unsigned int)USER_SCRIPTS_UPDATED;
     }
 
-    /* and finally we run the request_cleanup procedure (always set) */
-    
-    //if (Tcl_EvalObjEx(interp, private->request_cleanup, 0) == TCL_ERROR) {
-    //
-    //    ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, private->r, 
-    //                 MODNAME ": Error evaluating cleanup request: %s",
-    //                 Tcl_GetVar(interp, "errorInfo", 0));
-    //
-    //}
-
-    /* We finalize the request processing by printing the headers and flushing
-       the rivet channel internal buffer */
+    /* We finalize the request processing by printing the headers
+     * and flushing the rivet channel internal buffer */
 
     TclWeb_PrintHeaders(private->req);
     Tcl_Flush(*(running_channel));
diff --git a/src/mod_rivet_ng/worker_prefork_common.c b/src/mod_rivet_ng/worker_prefork_common.c
index a3f170c..a4a0a56 100644
--- a/src/mod_rivet_ng/worker_prefork_common.c
+++ b/src/mod_rivet_ng/worker_prefork_common.c
@@ -303,6 +303,13 @@ void Rivet_ProcessorCleanup (void *data)
 
         Tcl_DeleteInterp(private->ext->interps[i]->interp);
 
+       /* TODO: in view of restoring the ability of single Tcl interpreter deletion
+        * we must also consider to release the per-dir scripts hash table
+        * and the Tcl objects storing request handlers (this probably requires
+        * request handlers object to be instantiated by calling Tcl_DuplicateObj when
+        * needed TODO
+        */
+  
         /* if separate_virtual_interps == 0 we are running the same interpreter
          * instance for each vhost, thus we can jump out of this loop after 
          * the first cycle as the only real intepreter object we have is stored


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