Fix gratuitous assertion failure in Plink (ssh1_throttle_count was
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:04:44 +0000 (22:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:04:44 +0000 (22:04 +0000)
being decremented far too many times).

git-svn-id: svn://svn.tartarus.org/sgt/putty@1238 cda61777-01e9-0310-a592-d414129be87e

ssh.c

diff --git a/ssh.c b/ssh.c
index 36db4e7..845b01c 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -2709,7 +2709,7 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
                int bufsize =
                    from_backend(pktin.type == SSH1_SMSG_STDERR_DATA,
                                 pktin.body + 4, len);
-               if (bufsize > SSH1_BUFFER_LIMIT) {
+               if (!ssh1_stdout_throttling && bufsize > SSH1_BUFFER_LIMIT) {
                    ssh1_stdout_throttling = 1;
                    ssh1_throttle(+1);
                }
@@ -2955,7 +2955,7 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
                        bufsize = 0;   /* agent channels never back up */
                        break;
                    }
-                   if (bufsize > SSH1_BUFFER_LIMIT) {
+                   if (!c->v.v1.throttling && bufsize > SSH1_BUFFER_LIMIT) {
                        c->v.v1.throttling = 1;
                        ssh1_throttle(+1);
                    }
@@ -5113,7 +5113,7 @@ void *new_sock_channel(Socket s)
 void ssh_unthrottle(int bufsize)
 {
     if (ssh_version == 1) {
-       if (bufsize < SSH1_BUFFER_LIMIT) {
+       if (ssh1_stdout_throttling && bufsize < SSH1_BUFFER_LIMIT) {
            ssh1_stdout_throttling = 0;
            ssh1_throttle(-1);
        }