1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-12 16:47:42 -05:00

sshshare: notify cl when last downstream goes away.

The check_termination function in ssh2connection is supposed to be
called whenever it's possible that we've run out of (a) channels, and
(b) sharing downstreams. I've been calling it on every channel close,
but apparently completely forgot to add a callback from sshshare.c
that also arranges to call it when we run out of downstreams.
This commit is contained in:
Simon Tatham
2018-09-28 20:52:36 +01:00
parent 5a6608bda8
commit 57553bdaac
4 changed files with 26 additions and 1 deletions

View File

@ -127,6 +127,7 @@ static void ssh2_delete_sharing_channel(
ConnectionLayer *cl, unsigned localid);
static void ssh2_sharing_queue_global_request(
ConnectionLayer *cl, ssh_sharing_connstate *share_ctx);
static void ssh2_sharing_no_more_downstreams(ConnectionLayer *cl);
static int ssh2_agent_forwarding_permitted(ConnectionLayer *cl);
static void ssh2_terminal_size(ConnectionLayer *cl, int width, int height);
static void ssh2_stdout_unthrottle(ConnectionLayer *cl, int bufsize);
@ -144,6 +145,7 @@ static const struct ConnectionLayerVtable ssh2_connlayer_vtable = {
ssh2_alloc_sharing_channel,
ssh2_delete_sharing_channel,
ssh2_sharing_queue_global_request,
ssh2_sharing_no_more_downstreams,
ssh2_agent_forwarding_permitted,
ssh2_terminal_size,
ssh2_stdout_unthrottle,
@ -2096,6 +2098,13 @@ static void ssh2_sharing_queue_global_request(
ssh2_queue_global_request_handler(s, ssh2_sharing_globreq_response, cs);
}
static void ssh2_sharing_no_more_downstreams(ConnectionLayer *cl)
{
struct ssh2_connection_state *s =
FROMFIELD(cl, struct ssh2_connection_state, cl);
queue_toplevel_callback(ssh2_check_termination_callback, s);
}
static struct X11FakeAuth *ssh2_add_sharing_x11_display(
ConnectionLayer *cl, int authtype, ssh_sharing_connstate *share_cs,
share_channel *share_chan)