Stephen Deasey schrieb:
> Here's some problems with ns_conn channel:
>
> - ssl: if you use it (or any other comm module) you'll be surprised
> when 'puts' gets written in clear text.
>
> - If you 'puts' rather than ns_write, you may be surprised when
> automatic chunking, encoding, compression doesn't work.
>
> - maxconnections: The server thinks it knows how many clients it's
> serving, but by stashing away the socket and returning the conn, it's
> under counting.
>
> - Accounting for number-of-bytes-written is weak (as it is with the ns
> background writer threads).
>   
all true, but effects mostly the writer commands (puts/fcopy/etc). Maybe 
one should
add handling of persistent connections to that list. The problem is not
so much that raw puts/fcopy don't handle these cases (how should it),
but that there is currently no nice way to deal with such issues.

> We could fix this by creating a custom channel type to wrap the conn
> socket rather than use the standard TcpChannel.
>
> ...
> Secondly, none of our Ns_ConnWrite* calls support an asynchronous mode.
>   
It should be possible to do async i/o on the raw channel
(maybe rename "ns_conn channel" to "ns_conn rawchannel"), call
ns_write from the readable/writable callbacks and provide
an argument to ns_write for the channel. Based on that it should be
possible to provide a fcopy based on ns_write with little effort.

This does not address the problem of needing the Conn structure. An option
might be to provide essentially a deep copy of conn and pass this in
the custom channel.

We discussed something very similar some time ago in context of the writer
threads, where a more flexible model on passing control between spooling
and worker threads sounds interesting (e.g. checking on file uploads
the quota via database, do spooling, do postprocessing in workter thread).

-gustaf


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to