]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commit
Replace the hacky 'OSSocket' type with a closure.
authorSimon Tatham <anakin@pobox.com>
Sun, 17 Nov 2013 14:03:55 +0000 (14:03 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 17 Nov 2013 14:03:55 +0000 (14:03 +0000)
commit302dbd51f23d526ddd9262a84a08cd0ac928e9c3
tree14749f78a48bb99c6ca511aa1a00642b82e96901
parent89d4488b580e56be587fb53b87670130d6ede2da
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.

git-svn-id: http://svn.tartarus.org/sgt/putty@10068 cda61777-01e9-0310-a592-d414129be87e
network.h
portfwd.c
proxy.c
proxy.h
unix/unix.h
unix/uxnet.c
windows/winnet.c
x11fwd.c