simon-svn: putty: simon

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Thu Dec 8 19:15:59 GMT 2011


SVN root:       svn://svn.tartarus.org/sgt
Changes by:     simon
Revision:       9364
Date:           2011-12-08 19:15:58 +0000 (Thu, 08 Dec 2011)

Log message (19 lines):
Introduce a function sshfwd_unclean_close(), supplied by ssh.c to
subsidiary network modules like portfwd.c. To be called when the
subsidiary module experiences a socket error: it sends an emergency
CHANNEL_CLOSE (not just outgoing CHANNEL_EOF), and immediately deletes
the local side of the channel. (I've invented a new channel type in
ssh.c called CHAN_ZOMBIE, for channels whose original local side has
already been thrown away and they're just hanging around waiting to
receive the acknowledging CHANNEL_CLOSE.)

As a result of this and the last few commits, I can now run a port
forwarding session in which a local socket error occurs on a forwarded
port, and PuTTY now handles it apparently correctly, closing both the
SSH channel and the local socket and then actually recognising that
it's OK to terminate when all _other_ channels have been closed.
Previously the channel corresponding to the duff connection would
linger around (because of net_pending_errors never being called), and
keep being selected on (hence chewing CPU), and inhibit program
termination at the end of the session (because not all channels were
closed).

Modified files:
U   putty/portfwd.c
U   putty/ssh.c
U   putty/ssh.h

Links:
http://svn.tartarus.org/sgt/?rev=9364&view=rev
http://svn.tartarus.org/sgt/putty/portfwd.c?rev=9364&r1=9363&r2=9364
http://svn.tartarus.org/sgt/putty/ssh.c?rev=9364&r1=9363&r2=9364
http://svn.tartarus.org/sgt/putty/ssh.h?rev=9364&r1=9363&r2=9364



More information about the tartarus-commits mailing list