mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
Fix handling of SSH2_MSG_CHANNEL_CLOSE, which was breaking in port
forwarding talking to ssh.com's ssh-3.0.1. [originally from svn r1216]
This commit is contained in:
parent
4692974d7d
commit
5c646f3270
17
ssh.c
17
ssh.c
@ -4729,22 +4729,29 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
|
|||||||
c = find234(ssh_channels, &i, ssh_channelfind);
|
c = find234(ssh_channels, &i, ssh_channelfind);
|
||||||
if (!c)
|
if (!c)
|
||||||
continue; /* nonexistent channel */
|
continue; /* nonexistent channel */
|
||||||
if (c->closes == 0) {
|
|
||||||
ssh2_pkt_init(SSH2_MSG_CHANNEL_CLOSE);
|
|
||||||
ssh2_pkt_adduint32(c->remoteid);
|
|
||||||
ssh2_pkt_send();
|
|
||||||
}
|
|
||||||
/* Do pre-close processing on the channel. */
|
/* Do pre-close processing on the channel. */
|
||||||
switch (c->type) {
|
switch (c->type) {
|
||||||
case CHAN_MAINSESSION:
|
case CHAN_MAINSESSION:
|
||||||
break; /* nothing to see here, move along */
|
break; /* nothing to see here, move along */
|
||||||
case CHAN_X11:
|
case CHAN_X11:
|
||||||
|
if (c->u.x11.s != NULL)
|
||||||
|
x11_close(c->u.x11.s);
|
||||||
|
sshfwd_close(c);
|
||||||
break;
|
break;
|
||||||
case CHAN_AGENT:
|
case CHAN_AGENT:
|
||||||
|
sshfwd_close(c);
|
||||||
break;
|
break;
|
||||||
case CHAN_SOCKDATA:
|
case CHAN_SOCKDATA:
|
||||||
|
if (c->u.pfd.s != NULL)
|
||||||
|
pfd_close(c->u.pfd.s);
|
||||||
|
sshfwd_close(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (c->closes == 0) {
|
||||||
|
ssh2_pkt_init(SSH2_MSG_CHANNEL_CLOSE);
|
||||||
|
ssh2_pkt_adduint32(c->remoteid);
|
||||||
|
ssh2_pkt_send();
|
||||||
|
}
|
||||||
del234(ssh_channels, c);
|
del234(ssh_channels, c);
|
||||||
bufchain_clear(&c->v.v2.outbuffer);
|
bufchain_clear(&c->v.v2.outbuffer);
|
||||||
sfree(c);
|
sfree(c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user