1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 02:57:33 -05:00

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]
This commit is contained in:
Simon Tatham
2011-12-08 19:15:58 +00:00
parent f892af999e
commit 49927f6c4d
3 changed files with 51 additions and 12 deletions

1
ssh.h
View File

@ -11,6 +11,7 @@ struct ssh_channel;
extern int sshfwd_write(struct ssh_channel *c, char *, int);
extern void sshfwd_write_eof(struct ssh_channel *c);
extern void sshfwd_unclean_close(struct ssh_channel *c);
extern void sshfwd_unthrottle(struct ssh_channel *c, int bufsize);
/*