From df9888023b27a5d24c16ed857a10f391b440bd42 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 21 Jul 2013 10:12:58 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@9953 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ssh.c b/ssh.c index 16ef0567..a3255a85 100644 --- a/ssh.c +++ b/ssh.c @@ -7094,6 +7094,15 @@ static void ssh2_msg_channel_close(Ssh ssh, struct Packet *pktin) } /* + * 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. */ sshfwd_write_eof(c); -- 2.11.0