From ba5e56cd1b448ac7d97e2d8d7cb9eafab66a45b9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 13 Jun 2018 19:44:44 +0100 Subject: [PATCH] Add a missing check of outgoing_data. When the whole SSH connection is throttled and then unthrottled, we need to requeue the callback that transfers data to the Socket from the new outgoing_data queue introduced in commit 9e3522a97. The user-visible effect of this missing call was that outgoing SFTP transactions would lock up, because in SFTP mode we enable the "simple@putty.projects.tartarus.org" mode and essentially turn off the per-channel window management, so throttling of the whole connection becomes the main source of back-pressure. --- ssh.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ssh.c b/ssh.c index 9f8d0314..7df6b509 100644 --- a/ssh.c +++ b/ssh.c @@ -2310,11 +2310,14 @@ static void ssh_sent(Plug plug, int bufsize) { Ssh ssh = FROMFIELD(plug, struct ssh_tag, plugvt); /* - * If the send backlog on the SSH socket itself clears, we - * should unthrottle the whole world if it was throttled. + * If the send backlog on the SSH socket itself clears, we should + * unthrottle the whole world if it was throttled, and also resume + * sending our bufchain of queued wire data. */ - if (bufsize < SSH_MAX_BACKLOG) + if (bufsize < SSH_MAX_BACKLOG) { ssh_throttle_all(ssh, 0, bufsize); + queue_idempotent_callback(&ssh->outgoing_data_sender); + } } static void ssh_hostport_setup(const char *host, int port, Conf *conf,