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 2014/09/08 18:30:46 UTC

svn commit: r1623428 - in /tcl/rivet/trunk: ChangeLog src/experimental/mod_rivet.c

Author: mxmanghi
Date: Mon Sep  8 16:30:46 2014
New Revision: 1623428

URL: http://svn.apache.org/r1623428
Log:
    * src/experimental/mod_rivet.c: handling per dir configurations that have no Rivet directives
    in them, thus leaving the patch field NULL.


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/src/experimental/mod_rivet.c

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1623428&r1=1623427&r2=1623428&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Mon Sep  8 16:30:46 2014
@@ -1,3 +1,7 @@
+2014-09-08 Massimo Manghi <mx...@apache.org>
+    * src/experimental/mod_rivet.c: handling per dir configurations that have no Rivet directives
+    in them, thus leaving the patch field NULL.
+
 2014-09-07 Massimo Manghi <mx...@apache.org>
     * src/experimental/mod_rivet.h: add field path to rivet_server_conf. This field carries
     a copy of the 'path' field in cmd_parms. This field is NULL for global and <VirtualHost>

Modified: tcl/rivet/trunk/src/experimental/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/experimental/mod_rivet.c?rev=1623428&r1=1623427&r2=1623428&view=diff
==============================================================================
--- tcl/rivet/trunk/src/experimental/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/experimental/mod_rivet.c Mon Sep  8 16:30:46 2014
@@ -401,33 +401,43 @@ Rivet_SendContent(rivet_thread_private *
 
         rdc = RIVET_SERVER_CONF(dconf); 
 
-        /* Let's check if a scripts object is already stored in the per-dir hash table */
+        if (rdc == NULL)
+        {
+            /* a Directory sections exists but there were no Rivet configuration directives in it */
 
-        private->running = 
-            (running_scripts *) apr_hash_get (interp_obj->per_dir_scripts,rdc->path,strlen(rdc->path));
+            private->running = interp_obj->scripts;
 
-        if (private->running == NULL)
+        }
+        else
         {
-            rivet_server_conf*  newconfig   = NULL;
-            running_scripts*    scripts     = 
-                        (running_scripts *) apr_pcalloc (interp_obj->pool,sizeof(running_scripts));
-
-            newconfig = RIVET_NEW_CONF(r->pool);
-
-            Rivet_CopyConfig( private->running_conf, newconfig );
-            Rivet_MergeDirConfigVars( r->pool, newconfig, private->running_conf, rdc );
-            private->running_conf = newconfig;
-
-            RIVET_SCRIPT_INIT (scripts,newconfig,rivet_before_script);
-            RIVET_SCRIPT_INIT (scripts,newconfig,rivet_after_script);
-            RIVET_NULL_SCRIPT_INIT (scripts,newconfig,rivet_error_script);
-            RIVET_NULL_SCRIPT_INIT (scripts,newconfig,rivet_abort_script);
-            RIVET_NULL_SCRIPT_INIT (scripts,newconfig,after_every_script);
- 
-            apr_hash_set (interp_obj->per_dir_scripts,rdc->path,strlen(rdc->path),scripts);
-           
-            private->running = scripts;
+            /* Let's check if a scripts object is already stored in the per-dir hash table */
 
+            private->running = 
+                (running_scripts *) apr_hash_get (interp_obj->per_dir_scripts,rdc->path,strlen(rdc->path));
+
+            if (private->running == NULL)
+            {
+                rivet_server_conf*  newconfig   = NULL;
+                running_scripts*    scripts     = 
+                            (running_scripts *) apr_pcalloc (interp_obj->pool,sizeof(running_scripts));
+
+                newconfig = RIVET_NEW_CONF(r->pool);
+
+                Rivet_CopyConfig( private->running_conf, newconfig );
+                Rivet_MergeDirConfigVars( r->pool, newconfig, private->running_conf, rdc );
+                private->running_conf = newconfig;
+
+                RIVET_SCRIPT_INIT (scripts,newconfig,rivet_before_script);
+                RIVET_SCRIPT_INIT (scripts,newconfig,rivet_after_script);
+                RIVET_NULL_SCRIPT_INIT (scripts,newconfig,rivet_error_script);
+                RIVET_NULL_SCRIPT_INIT (scripts,newconfig,rivet_abort_script);
+                RIVET_NULL_SCRIPT_INIT (scripts,newconfig,after_every_script);
+     
+                apr_hash_set (interp_obj->per_dir_scripts,rdc->path,strlen(rdc->path),scripts);
+               
+                private->running = scripts;
+
+            }
         }
     }
     else



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