]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Introduce a function sshfwd_unclean_close(), supplied by ssh.c to
authorSimon Tatham <anakin@pobox.com>
Thu, 8 Dec 2011 19:15:58 +0000 (19:15 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 8 Dec 2011 19:15:58 +0000 (19:15 +0000)
commit49927f6c4dc619865ade72fabd0f659726bc0908
treeeb5ef08cdbef0c00a670e360dd291f8593f4834a
parentf892af999e245675aae2b037ffb4bb873a1d0392
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).

[originally from svn r9364]
portfwd.c
ssh.c
ssh.h