tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: fixme's
Date Thu, 21 Feb 2002 00:55:37 GMT

How about just doing this?  (In interpool.c)

	stat statPtr;
	if (Tcl_Access(id, R_OK) != 0 ||
	    Tcl_Stat(id, &statPtr) != TCL_OK)
	{
	    return NULL;
	}
	mtime = statPtr->st_mtime;
#if 0
	/* take mtime from system */
	Tcl_Obj *fileCmd = Tcl_NewStringObj("file mtime ", -1);
	Tcl_AppendToObj(fileCmd, id, -1);
	Tcl_IncrRefCount(fileCmd);

	if (Tcl_EvalObjEx(conf->mainInterp, fileCmd, 0) == TCL_OK) {
	    /* we don't really care if it works or not */
	    Tcl_GetLongFromObj(conf->mainInterp,
			       Tcl_GetObjResult(conf->mainInterp), &mtime);
	}

	Tcl_ResetResult(conf->mainInterp);
	Tcl_DecrRefCount(fileCmd);
#endif

Although it seems to me that the code above is not right, as it
shouldn't be putting anything into mtime, which is defined here:

WebInterp *poolGetWebInterp(websh_server_conf * conf, char *filename,
			    long mtime, request_rec * r)

And called like this:

    webInterp = poolGetWebInterp(conf, r->filename, r->finfo.st_mtime, r);

It's trying to fill in another value that it should really just leave
alone.

Of course, it's late and I may be mistaken,
-- 
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: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Mime
View raw message