AOL Webserver - Re: ns_conn channel

This is Interesting: Free IT Magazines  
Home > Archive > AOL Webserver > October 2007 > Re: ns_conn channel





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: ns_conn channel
Tom Jackson

2007-10-01, 7:11 pm

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 <tom@RMADILO.COM> wrote:
>
> 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?



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com