1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-21 22:28:37 -05:00

Fix gratuitous assertion failure in Plink (ssh1_throttle_count was

being decremented far too many times).

[originally from svn r1238]
This commit is contained in:
Simon Tatham 2001-09-07 22:04:44 +00:00
parent f1c2f2fcf0
commit 47e97ae032

6
ssh.c
View File

@ -2709,7 +2709,7 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
int bufsize = int bufsize =
from_backend(pktin.type == SSH1_SMSG_STDERR_DATA, from_backend(pktin.type == SSH1_SMSG_STDERR_DATA,
pktin.body + 4, len); pktin.body + 4, len);
if (bufsize > SSH1_BUFFER_LIMIT) { if (!ssh1_stdout_throttling && bufsize > SSH1_BUFFER_LIMIT) {
ssh1_stdout_throttling = 1; ssh1_stdout_throttling = 1;
ssh1_throttle(+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 */ bufsize = 0; /* agent channels never back up */
break; break;
} }
if (bufsize > SSH1_BUFFER_LIMIT) { if (!c->v.v1.throttling && bufsize > SSH1_BUFFER_LIMIT) {
c->v.v1.throttling = 1; c->v.v1.throttling = 1;
ssh1_throttle(+1); ssh1_throttle(+1);
} }
@ -5113,7 +5113,7 @@ void *new_sock_channel(Socket s)
void ssh_unthrottle(int bufsize) void ssh_unthrottle(int bufsize)
{ {
if (ssh_version == 1) { if (ssh_version == 1) {
if (bufsize < SSH1_BUFFER_LIMIT) { if (ssh1_stdout_throttling && bufsize < SSH1_BUFFER_LIMIT) {
ssh1_stdout_throttling = 0; ssh1_stdout_throttling = 0;
ssh1_throttle(-1); ssh1_throttle(-1);
} }