From 55d19f62951f6fd91350728fd3573bad87e663c6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 21 Aug 2022 12:58:01 +0100 Subject: [PATCH] Fix session channel unthrottling in psusan and Uppity. I ran 'ls /usr/share/doc' in a psusan session the other day and the output hung part way through the long directory listing. This turned out to be because the ssh-connection channel window had run out temporarily, and PuTTY had sent a WINDOW_ADJUST extending it again, which the connection layer acted on by calling chan_set_input_wanted ... which sesschan was ignoring with a comment saying /* I don't think we need to do anything here */. Well, turns out we do need to. Implemented the simplest possible unblocking action. --- ssh/sesschan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ssh/sesschan.c b/ssh/sesschan.c index b8f9311e..9776eaf2 100644 --- a/ssh/sesschan.c +++ b/ssh/sesschan.c @@ -292,7 +292,11 @@ static char *sesschan_log_close_msg(Channel *chan) static void sesschan_set_input_wanted(Channel *chan, bool wanted) { - /* I don't think we need to do anything here */ + sesschan *sess = container_of(chan, sesschan, chan); + /* Request the back end to resume sending input, if it had become + * throttled by the channel window shortening */ + if (wanted && sess->backend) + backend_unthrottle(sess->backend, 0); } static void sesschan_start_backend(sesschan *sess, const char *cmd)