]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Don't send SSH_MSG_CHANNEL_WINDOW_ADJUST with a zero adjustment.
authorBen Harris <bjh21@bjh21.me.uk>
Tue, 17 May 2016 14:28:56 +0000 (16:28 +0200)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 20 May 2016 20:33:46 +0000 (21:33 +0100)
ssh.c

diff --git a/ssh.c b/ssh.c
index 51605ab71533b28c751d522d52c442afb5d567d5..bd202adde9d3d90393a55cc30e909f8c8a1a403d 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -7883,7 +7883,8 @@ static void ssh_channel_unthrottle(struct ssh_channel *c, int bufsize)
            buflimit = 0;
        else
            buflimit = c->v.v2.locmaxwin;
-       ssh2_set_window(c, bufsize < buflimit ? buflimit - bufsize : 0);
+       if (bufsize < buflimit)
+           ssh2_set_window(c, buflimit - bufsize);
     }
     if (c->throttling_conn && bufsize <= buflimit) {
        c->throttling_conn = 0;
@@ -8115,8 +8116,8 @@ static void ssh2_msg_channel_data(Ssh ssh, struct Packet *pktin)
         * need to adjust the window if the server's
         * sent excess data.
         */
-       ssh2_set_window(c, bufsize < c->v.v2.locmaxwin ?
-                       c->v.v2.locmaxwin - bufsize : 0);
+       if (bufsize < c->v.v2.locmaxwin)
+           ssh2_set_window(c, c->v.v2.locmaxwin - bufsize);
        /*
         * If we're either buffering way too much data, or if we're
         * buffering anything at all and we're in "simple" mode,