]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Make sure we never send window adjustments (or winadjes) on channels
authorSimon Tatham <anakin@pobox.com>
Thu, 8 Dec 2011 19:15:53 +0000 (19:15 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 8 Dec 2011 19:15:53 +0000 (19:15 +0000)
for which we've already sent CHANNEL_CLOSE. It would be embarrassing
if the remote end had also sent CHANNEL_CLOSE in response and then
received our communication once it had forgotten about the channel.

[originally from svn r9360]

ssh.c

diff --git a/ssh.c b/ssh.c
index 3464ea54614875f41a927b07037a460f2d329fcd..6471c4b85cb94f82b2257b5b70f7ad37492dc5c2 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -6551,9 +6551,10 @@ static void ssh2_set_window(struct ssh_channel *c, int newwin)
     /*
      * Never send WINDOW_ADJUST for a channel that the remote side has
      * already sent EOF on; there's no point, since it won't be
-     * sending any more data anyway.
+     * sending any more data anyway. Ditto if _we've_ already sent
+     * CLOSE.
      */
-    if (c->closes & CLOSES_RCVD_EOF)
+    if (c->closes & (CLOSES_RCVD_EOF | CLOSES_SENT_CLOSE))
        return;
 
     /*