tcl-mod_dtcl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject cvs commit: tcl-moddtcl mod_dtcl.c
Date Tue, 28 Aug 2001 11:41:39 GMT
davidw      01/08/28 04:41:39

  Modified:    .        mod_dtcl.c
  Log:
  Clean up get_tcl_file.
  Switch to hex numbers for hashing/cacheing of scripts.
  
  Revision  Changes    Path
  1.46      +5 -15     tcl-moddtcl/mod_dtcl.c
  
  Index: mod_dtcl.c
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- mod_dtcl.c	2001/08/08 15:01:51	1.45
  +++ mod_dtcl.c	2001/08/28 11:41:39	1.46
  @@ -57,7 +57,7 @@
    * originally written at the National Center for Supercomputing Applications,
    * University of Illinois, Urbana-Champaign.  */
   
  -/* $Id: mod_dtcl.c,v 1.45 2001/08/08 15:01:51 davidw Exp $  */
  +/* $Id: mod_dtcl.c,v 1.46 2001/08/28 11:41:39 davidw Exp $  */
   
   /* mod_dtcl.c by David Welton <davidw@apache.org> - originally mod_include.  */
   /* See http://tcl.apache.org/mod_dtcl/credits.ttml for additional credits. */
  @@ -321,14 +321,13 @@
   
       /* Basically, what we are doing here is a Tcl_EvalFile, but
          with the addition of caching code. */
  -    char *cmdBuffer = (char *) NULL;
       Tcl_Channel chan = Tcl_OpenFileChannel(interp, r->filename, "r", 0644);
       if (chan == (Tcl_Channel) NULL)
       {
   	Tcl_ResetResult(interp);
   	Tcl_AppendResult(interp, "couldn't read file \"", r->filename,
   			 "\": ", Tcl_PosixError(interp), (char *) NULL);
  -	goto error;
  +	return TCL_ERROR;
       }
   
       result = Tcl_ReadChars(chan, outbuf, r->finfo.st_size, 1);
  @@ -337,21 +336,12 @@
   	Tcl_Close(interp, chan);
   	Tcl_AppendResult(interp, "couldn't read file \"", r->filename,
   			 "\": ", Tcl_PosixError(interp), (char *) NULL);
  -	goto error;
  +	return TCL_ERROR;
       }
   
       if (Tcl_Close(interp, chan) != TCL_OK)
  -	goto error;
  +	return TCL_ERROR;
   
  -    /* yuck  */
  -    goto end;
  -error:
  -    if (cmdBuffer != (char *) NULL) {
  -	free(cmdBuffer);
  -    }
  -    return TCL_ERROR;
  -
  -end:
       return TCL_OK;
   #else
       Tcl_EvalFile(interp, r->filename);
  @@ -478,7 +468,7 @@
          create it. */
       if (*(dsc->cache_size))
       {
  -	hashKey = ap_psprintf(r->pool, "%s%ld%ld%d", r->filename, r->finfo.st_mtime,
r->finfo.st_ctime, toplevel);
  +	hashKey = ap_psprintf(r->pool, "%s%lx%lx%d", r->filename, r->finfo.st_mtime,
r->finfo.st_ctime, toplevel);
   	entry = Tcl_CreateHashEntry(dsc->objCache, hashKey, &isNew);
       }
       if (isNew || *(dsc->cache_size) == 0)
  
  
  

Mime
View raw message