Well there are some surprising things in this change. I'm not sure what the 
spliceout variable means, but it is unrelated to the Ns_ and Tcl_ spliceout 
functions, and I have no idea what they do yet. 

But the nContentSent (and sock) member is private to a Conn, not even visible 
in a Ns_Conn, so I was worried this could be abused somehow. But I also 
didn't realize that nContentSent is set in the connection thread, not in the 
worker thread, unless I'm wrong about this, which would mean that the worker 
thread is directly setting nContentSent in another thread. I can't test this, 
but you don't pass in a $conn to the call, so there can't be more than one 
hanging around. 

With a module it is also easier to hack away without needing to re-make 
install nsd.

I just posted the module code so it is easier to examine in context:
http://rmadilo.com/files/nsbgwrite/

Note that there are some differences. Certain information is available via the 
public API, and I have replaced that code with the public API call. I also 
replaced 'int sock' with 'SOCKET sock' to reflect other uses.

One warning in the patch and module is in:
Conn       *connPtr = (Conn *) conn;

The same code is used in a few other places in tclresp.c (I think), with the 
same warning. 

tom jackson


On Monday 01 October 2007 10:11, Dossy Shiobara wrote:
> On 2007.10.01, Tom Jackson <[EMAIL PROTECTED]> wrote:
> > On the surface, the patch appears (as described) to do something like
> > ns_returnfile. All the patch does is to make a copy of the connection
> > and wrap the sock in a Tcl_Channel.
>
> My only real concern about the change:
>
> What happens if you try to [ns_chan create] on the Tcl channel returned
> from [ns_conn channel]?  Does the actual behavior line up with what one
> might normally expect (i.e., Policy of Least Surprise)?  Is the behavior
> well-defined?


--
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