You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by "David N. Welton" <da...@dedasys.com> on 2003/06/03 20:44:03 UTC

.htaccess problems

I added this to my local copy of mod_rivet.c to play around with.  I
was, infact, getting some weird segfaults because of this:

    if (isNew || *(rsc->cache_size) == 0 || rsc->user_scripts_updated)

which I got rid of.  Now it just plain cleans the whole cache out when
the config file changes.  Unfortunately, as things stand now, the
config file 'changes' every time the UserConf function gets called.

In short, we need a way to obtain information about .htaccess
modification times (all the way up the chain, I'm afraid!) in order to
include that in the cache information.

In reality, I almost think that this might best be done with some sort
of addition to Apache itself that tells you whether the .htaccess
files concerning the resource requested have changed, but that's not
very probably or realistic...

Any thoughts?

--- mod_rivet.c 26 May 2003 21:20:25 -0000      1.64
+++ mod_rivet.c 3 Jun 2003 18:35:04 -0000
@@ -203,8 +203,37 @@
        entry = Tcl_CreateHashEntry(rsc->objCache, hashKey, &isNew);
     }
 
-    /* We don't have a compiled version.  Let's create one */
-    if (isNew || *(rsc->cache_size) == 0 || rsc->user_scripts_updated)
+    /* If the user configuration has indeed been updated, I guess that
+     * pretty much invalidates anything that might have been
+     * cached. */
+
+    /* This is all horrendously slow, and means we should *also* be
+       doing caching on the modification time of the .htaccess files
+       that concern us. */
+
+    if (rsc->user_scripts_updated && *(rsc->cache_size) != 0) {
+       int ct;
+       Tcl_HashEntry *delEntry;
+       /* Clean out the list. */
+       ct = *(rsc->cache_free);
+       while (ct < *(rsc->cache_size)) {
+           /* Free the corresponding hash entry. */
+           delEntry = Tcl_FindHashEntry(
+               rsc->objCache,
+               rsc->objCacheList[ct]);
+           if (delEntry != NULL)
+               Tcl_DecrRefCount((Tcl_Obj *)Tcl_GetHashValue(delEntry));
+           Tcl_DeleteHashEntry(delEntry);
+
+           free(rsc->objCacheList[ct]);
+           rsc->objCacheList[ct] = NULL;
+           ct ++;
+       }
+       *(rsc->cache_free) = *(rsc->cache_size);
+    }
+
+    /* We don't have a compiled version.  Let's create one. */
+    if (isNew || *(rsc->cache_size) == 0)
     {
        outbuf = Tcl_NewObj();
        if (toplevel) {


-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

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


Re: .htaccess problems

Posted by "David N. Welton" <da...@dedasys.com>.
Committed the change.  We really need to find a way around this,
because it slows things down a great deal.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

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