Hi folks,

I wrote the code. The explanation below is correct -- I chose inode/ dev combination to cache the same file even with multiple names which was the case at AOL -- hundreds of symlinks and hard links to the same file. The same strategy is used for ADP templates. I think the code uses just filenames on Windows because the inode/dev don't really exist in Win32 weirdness (or at least I didn't care enough to find the proper analog).

As for whether this is a bug or not, opinions vary. I would suggest the code snippet of create temp file and use fastpath to return contents is not a use case I was solving for or recommend. The suggestion to open a temp fd, unlink it, dump content into and send from the open fd seems the better approach for a few reason including proper cleanup after a crash. In fact, there is an API for such cases -- Ns_GetTemp or something -- and it's used internally, for example, to spool large file uploads. It re-uses open and unlinked fd's -- in practice file create is expensive and is avoided by just keeping a cache of open fd's around, truncating the content at the end of the connection. I'm not sure if the docs are up to date and/or if there are useful Tcl commands but something could be added easily if needed.

Having said all that, a note in the docs that "ns_returnfile is designed for truly static content..." and comments on how the cache works and can be disabled would make sense.

-Jim





On Aug 18, 2008, at 7:37 PM, Tom Jackson wrote:

On Mon, 2008-08-18 at 15:38 -0700, Jeff Rogers wrote:
While I'd agree this is a bug in fastpath, the real problem is that
fastpath is being used at all in this case.

I don't think it is a bug in fastpath.

Think about the case where multiple logical files are actually the same
physical file. Using the name would result in caching the same object
under different names. This is a much more likely situation than this so
called bug.

tom jackson


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED] > with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to