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

If the SSH server sends us CHANNEL_CLOSE for a channel on which we're

sitting on a pile of buffered data waiting for WINDOW_ADJUSTs, we
should throw away that buffered data, because the CHANNEL_CLOSE tells
us that we won't be receiving those WINDOW_ADJUSTs, and if we hang on
to the data and keep trying then it'll prevent ssh_channel_try_eof
from sending the CHANNEL_EOF which is a prerequisite of sending our
own CHANNEL_CLOSE.

[originally from svn r9953]
This commit is contained in:
Simon Tatham 2013-07-21 10:12:58 +00:00
parent 4f457ff7f2
commit eaea69ef53

9
ssh.c
View File

@ -7093,6 +7093,15 @@ static void ssh2_msg_channel_close(Ssh ssh, struct Packet *pktin)
break;
}
/*
* Abandon any buffered data we still wanted to send to this
* channel. Receiving a CHANNEL_CLOSE is an indication that
* the server really wants to get on and _destroy_ this
* channel, and it isn't going to send us any further
* WINDOW_ADJUSTs to permit us to send pending stuff.
*/
bufchain_clear(&c->v.v2.outbuffer);
/*
* Send outgoing EOF.
*/