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 da...@apache.org on 2003/06/12 17:32:05 UTC

cvs commit: tcl-rivet/src mod_rivet.c

davidw      2003/06/12 08:32:05

  Modified:    .        ChangeLog
               src      mod_rivet.c
  Log:
  * src/mod_rivet.c (Rivet_ParseExecFile): Rework checks for .htaccess
    file changes.  This code was causing an obscure bug where a file
    would be in the cache twice, thus causing crashes.
  
  Revision  Changes    Path
  1.119     +27 -0     tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- ChangeLog	26 May 2003 21:20:24 -0000	1.118
  +++ ChangeLog	12 Jun 2003 15:32:04 -0000	1.119
  @@ -1,3 +1,30 @@
  +2003-06-12  David N. Welton  <da...@dedasys.com>
  +
  +	* src/mod_rivet.c (Rivet_ParseExecFile): Rework checks for
  +	.htaccess file changes.  This code was causing an obscure bug
  +	where a file would be in the cache twice, thus causing crashes.
  +
  +	* Moved russian translation around again.
  +
  +	* src/TclWebapache.c (TclWeb_GetEnvVars): Use TCL_NAMESPACE_ONLY
  +	here and in TclWeb_GetHeaderVars in order to set the variable in
  +	the correct place.
  +
  +	* src/make.tcl: Added changes to build Russian documentation.
  +
  +	* doc/rivet.xml: Added link to Russian translation.
  +
  +	* doc/rivet.ru_UTF.xml: Added link back to English version.
  +
  +2003-06-10  David N. Welton  <da...@dedasys.com>
  +
  +	* doc/rivet_utf_ru.xml: Added Russian translation of documentation
  +	by Dmitry Zuryanovich.
  +
  +2003-06-09  David N. Welton  <da...@dedasys.com>
  +
  +	* doc/rivet.xml: Cleaned up docs about fetching the httpd sources.
  +
   2003-05-26  David N. Welton  <da...@dedasys.com>
   
   	* src/rivetCore.c (Rivet_Headers): Change error message to better
  
  
  
  1.65      +41 -8     tcl-rivet/src/mod_rivet.c
  
  Index: mod_rivet.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/mod_rivet.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- mod_rivet.c	26 May 2003 21:20:25 -0000	1.64
  +++ mod_rivet.c	12 Jun 2003 15:32:04 -0000	1.65
  @@ -180,6 +180,36 @@
   
       rsc = Rivet_GetConf( req->req );
   
  +    /* 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. FIXME */
  +
  +    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);
  +    }
  +
  +
       /* If toplevel is 0, we are being called from Parse, which means
          we need to get the information about the file ourselves. */
       if (toplevel == 0)
  @@ -198,13 +228,14 @@
        */
       if (*(rsc->cache_size))
       {
  +
   	hashKey = ap_psprintf(req->req->pool, "%s%lx%lx%d", filename,
   			      mtime, ctime, toplevel);
   	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)
  +    /* We don't have a compiled version.  Let's create one. */
  +    if (isNew || *(rsc->cache_size) == 0)
       {
   	outbuf = Tcl_NewObj();
   	if (toplevel) {
  @@ -245,9 +276,9 @@
   	    rsc->objCacheList[-- *(rsc->cache_free) ] = strdup(hashKey);
   	} else if (*(rsc->cache_size)) { /* If it's zero, we just skip this. */
   	    Tcl_HashEntry *delEntry;
  -	    delEntry =
  -		Tcl_FindHashEntry(rsc->objCache,
  -				  rsc->objCacheList[*(rsc->cache_size)-1]);
  +	    delEntry = Tcl_FindHashEntry(
  +		rsc->objCache,
  +		rsc->objCacheList[*(rsc->cache_size) - 1]);
   	    Tcl_DecrRefCount((Tcl_Obj *)Tcl_GetHashValue(delEntry));
   	    Tcl_DeleteHashEntry(delEntry);
   	    free(rsc->objCacheList[*(rsc->cache_size) - 1]);
  @@ -431,7 +462,7 @@
   
       Rivet_PropagatePerDirConfArrays( interp, rdc );
   
  -    request_init = Tcl_NewStringObj("::Rivet::initialize_request\n",-1);
  +    request_init = Tcl_NewStringObj("::Rivet::initialize_request\n", -1);
       if (Tcl_EvalObjEx(interp, request_init, TCL_EVAL_DIRECT) == TCL_ERROR)
       {
   	ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
  @@ -440,7 +471,6 @@
   	goto sendcleanup;
       }
   
  -
       {
   	Tcl_Obj *infoscript[3];
   	infoscript[0] = Tcl_NewStringObj("info", -1);
  @@ -888,6 +918,8 @@
   	return "Rivet Error: RivetUserConf requires two arguments";
       }
       /* We have modified these scripts. */
  +    /* This is less than ideal though, because it will get set to 1
  +     * every time - FIXME. */
       rdc->user_scripts_updated = 1;
   
       string = Rivet_SetScript( cmd->pool, rdc, var, val );
  @@ -895,6 +927,7 @@
       ap_table_set( rdc->rivet_user_vars, var, string );
       return( NULL );
   }
  +
   
   /*
    * Merge the per-directory configuration options into a new configuration.
  
  
  

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