simon-svn: putty: simon

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sun Nov 17 14:03:57 GMT 2013


SVN root:       svn://svn.tartarus.org/sgt
Changes by:     simon
Revision:       10068
Date:           2013-11-17 14:03:55 +0000 (Sun, 17 Nov 2013)

Log message (19 lines):
Replace the hacky 'OSSocket' type with a closure.

The mechanism for constructing a new connection-type Socket when a
listening one receives an incoming connection previously worked by
passing a platform-specific 'OSSocket' type to the plug_accepting
function, which would then call sk_register to wrap it with a proper
Socket instance. This is less flexible than ideal, because it presumes
that only one kind of OS object might ever need to be turned into a
Socket. So I've replaced OSSocket throughout the code base with a pair
of parameters consisting of a function pointer and a context such that
passing the latter to the former returns the appropriate Socket; this
will permit different classes of listening Socket to pass different
function pointers.

In deference to the reality that OSSockets tend to be small integers
or pointer-sized OS handles, I've made the context parameter an
int/pointer union that can hold either of those directly, rather than
the usual approach of making it a plain 'void *' and requiring a
context structure to be dynamically allocated every time.

Modified files:
U   putty/network.h
U   putty/portfwd.c
U   putty/proxy.c
U   putty/proxy.h
U   putty/unix/unix.h
U   putty/unix/uxnet.c
U   putty/windows/winnet.c
U   putty/x11fwd.c

Links:
http://svn.tartarus.org/sgt/?rev=10068&view=rev
http://svn.tartarus.org/sgt/putty/network.h?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/portfwd.c?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/proxy.c?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/proxy.h?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/unix/unix.h?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/unix/uxnet.c?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/windows/winnet.c?rev=10068&r1=10067&r2=10068
http://svn.tartarus.org/sgt/putty/x11fwd.c?rev=10068&r1=10067&r2=10068



More information about the tartarus-commits mailing list