Looks like you already know what to do, so go ahead and cleanup that stuff.
Zoran Vasiljevic wrote:
Hi!
I'm in the process of cleaning up the code in order to
re-enable Windows compilation.
I've found several things we'd need to unify somehow:
We have (until recently) had only TCP protocol support
hence the calls like:
Ns_SockBind
Ns_SockListen
etc.
As of now, there are multiple other connection options
supported (raw sockets, udp sockets, unix domain sockets).
There are couple of places in the code where I see:
Ns_SockBindUdp
Ns_SockListenEx
Ns_SockListenUdp
Ns_SockListenRaw
Ns_SockListenUnix
I'd like to bring in some logic there. Therefore the proposal:
All TCP related calls should stay as-is.
We'd add additional calls to better identify what's being done:
Ns_SockListenTcp (new, should be called by Ns_SocketListen)
Ns_SockListenUdp (exists)
Ns_SockListenRaw (exists)
Ns_SockListenUnix (exists)
Then:
Ns_SockBindTcp (new, should be called by Ns_SocketBind)
Ns_SockBindUdp (exists)
Ns_SockBindRaw (new)
Ns_SockBindUnix (new)
In binder.c there are some calls which are only used withing the
file hence we'd need to adjust the call interface to illustrate
this:
Ns_SockRaw - > SockRaw
Also, the Ns_SockListenUnix is a combination of create + bind
but unlike other pendants, does not honour the preboundUnix sockets.
We should split this. Make the Ns_SockListenUnix actually
honour prebound sockets (which it does not do now) and use
internally the Ns_SockBindUnix to bind so it'd be on-pair with
the TCP.
All in all, this will not change the functionality but will
*definitely* improve understanding and code maintenance.
There are other places in sock.c which seem pretty odd like
Ns_SockBind calls Ns_BindSock
what is the reason of having those two (backward-compat?)
I will like to cleanup this now. Are there any voices against
or any other ideas?
Cheers
Zoran
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you
shotput
a projector? How fast can you ride your desk chair down the office luge
track?
If you want to score the big prize, get to know the little guy. Play to
win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/