1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

If we're called on to uncleanly close an SSH channel for which we've

already sent SSH2_MSG_CHANNEL_CLOSE, we should not skip the _whole_ of
sshfwd_unclean_close(), only the part about sending
SSH2_MSG_CHANNEL_CLOSE. It's still important to retag the SSH channel
as CHAN_ZOMBIE and clean up its previous data provider.

[originally from svn r9389]
This commit is contained in:
Simon Tatham 2012-01-26 18:22:28 +00:00
parent 736c5f86eb
commit 7c61b3c733

13
ssh.c
View File

@ -4266,13 +4266,13 @@ void sshfwd_unclean_close(struct ssh_channel *c)
if (ssh->state == SSH_STATE_CLOSED)
return;
if (c->closes & CLOSES_SENT_CLOSE)
return;
if (!(c->closes & CLOSES_SENT_CLOSE)) {
pktout = ssh2_pkt_init(SSH2_MSG_CHANNEL_CLOSE);
ssh2_pkt_adduint32(pktout, c->remoteid);
ssh2_pkt_send(ssh, pktout);
c->closes |= CLOSES_SENT_EOF | CLOSES_SENT_CLOSE;
}
pktout = ssh2_pkt_init(SSH2_MSG_CHANNEL_CLOSE);
ssh2_pkt_adduint32(pktout, c->remoteid);
ssh2_pkt_send(ssh, pktout);
c->closes |= CLOSES_SENT_EOF | CLOSES_SENT_CLOSE;
switch (c->type) {
case CHAN_X11:
x11_close(c->u.x11.s);
@ -4283,6 +4283,7 @@ void sshfwd_unclean_close(struct ssh_channel *c)
break;
}
c->type = CHAN_ZOMBIE;
ssh2_channel_check_close(c);
}