I noticed Rivet failed to parse complex 
templates composed by several nested .rvt files. 
It turned out the problem occurred only when at least 
2 templates were parsed within the same nesting level.

I put into apache-2/mod_rivet.c a test condition 
taken from the apache-1/mod_rivet.c that fixes
the problem. 

The patch also sets as 50 the default for the cache size

 -- Massimo


Index: ../../trunk/src/apache-2/mod_rivet.c
===================================================================
--- ../../trunk/src/apache-2/mod_rivet.c        (revision 685960)
+++ ../../trunk/src/apache-2/mod_rivet.c        (working copy)
@@ -302,9 +302,9 @@
  * Prints the error buffer if any.
  */
 static int
-Rivet_ExecuteAndCheck(Tcl_Interp *interp, Tcl_Obj *outbuf, request_rec *r)
+Rivet_ExecuteAndCheck(Tcl_Interp *interp, Tcl_Obj *outbuf, request_rec *req)
 {
-    rivet_server_conf *conf = Rivet_GetConf(r);
+    rivet_server_conf *conf = Rivet_GetConf(req);
     rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", NULL);

     if( Tcl_EvalObjEx(interp, outbuf, 0) == TCL_ERROR ) {
@@ -477,7 +477,7 @@
             }
         }

-        if (Rivet_CheckType(req->req) == RIVET_FILE)
+        if ((Rivet_CheckType(req->req) == RIVET_FILE) || !toplevel)
         {
             /* toplevel == 0 means we are being called from the parse
              * command, which only works on Rivet .rvt files. */
@@ -494,8 +494,7 @@
         }
         if (toplevel) {
             if (rsc->rivet_after_script) {
-                Tcl_AppendObjToObj(outbuf,
-                        Tcl_NewStringObj(rsc->rivet_after_script, -1));
+               
Tcl_AppendObjToObj(outbuf,Tcl_NewStringObj(rsc->rivet_after_script, -1));
             }
         }

@@ -525,7 +524,7 @@
             Tcl_DeleteHashEntry(delEntry);
             free(rsc->objCacheList[*(rsc->cache_size) - 1]);
             memmove((rsc->objCacheList) + 1, rsc->objCacheList,
-                    sizeof(char *) * (*(rsc->cache_size) -1));
+                    sizeof(char *) * (*(rsc->cache_size) - 1));

             //hkCopy = (char*) malloc ((strlen(hashKey)+1) * sizeof(char));
             //strcpy (rsc->objCacheList[0], hashKey);
@@ -945,8 +944,6 @@
     return Tcl_GetStringFromObj( objarg, NULL );
 }

-
-
 /*
  * Implements the RivetServerConf Apache Directive
  *
@@ -1371,7 +1368,7 @@
         if (ap_max_requests_per_child != 0) {
             *(rsc->cache_size) = ap_max_requests_per_child / 5;
         } else {
-            *(rsc->cache_size) = 10; /* FIXME: Arbitrary number */
+            *(rsc->cache_size) = 50; /* FIXME: Arbitrary number */
         }
     }

@@ -1634,9 +1631,6 @@

                apr_collapse_spaces(charset,charset);
                globals->req->charset = charset;
-
-//             fprintf(stderr,"conf charset --> %s\n",conf_charset);
-//             fflush(stderr);
            }
        }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to