diff options
author | Simon Tatham <anakin@pobox.com> | 2021-06-27 15:52:48 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2021-06-27 15:52:48 +0300 |
commit | 6246ff3f0a08c3d551f59c07813fee4640a67926 (patch) | |
tree | 21dcf320ca7c47c38b3c210af67f2f714e10373d /ssh.h | |
parent | ff941299cfc427f8ba2939d1950d8f954e3e3602 (diff) |
New Seat callback, seat_sent().
This is used to notify the Seat that some data has been cleared from
the backend's outgoing data buffer. In other words, it notifies the
Seat that it might be worth calling backend_sendbuffer() again.
We've never needed this before, because until now, Seats have always
been the 'main program' part of the application, meaning they were
also in control of the event loop. So they've been able to call
backend_sendbuffer() proactively, every time they go round the event
loop, instead of having to wait for a callback.
But now, the SSH proxy is the first example of a Seat without
privileged access to the event loop, so it has no way to find out that
the backend's sendbuffer has got smaller. And without that, it can't
pass that notification on to plug_sent, to unblock in turn whatever
the proxied connection might have been waiting to send.
In fact, before this commit, sshproxy.c never called plug_sent at all.
As a result, large data uploads over an SSH jump host would hang
forever as soon as the outgoing buffer filled up for the first time:
the main backend (to which sshproxy.c was acting as a Socket) would
carefully stop filling up the buffer, and then never receive the call
to plug_sent that would cause it to start again.
The new callback is ignored everywhere except in sshproxy.c. It might
be a good idea to remove backend_sendbuffer() entirely and convert all
previous uses of it into non-empty implementations of this callback,
so that we've only got one system; but for the moment, I haven't done
that.
Diffstat (limited to 'ssh.h')
-rw-r--r-- | ssh.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -402,6 +402,7 @@ bool ssh_is_bare(Ssh *ssh); /* Communications back to ssh.c from the BPP */ void ssh_conn_processed_data(Ssh *ssh); +void ssh_sendbuffer_changed(Ssh *ssh); void ssh_check_frozen(Ssh *ssh); /* Functions to abort the connection, for various reasons. */ |