mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -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:
12
sshshare.c
12
sshshare.c
@ -905,12 +905,22 @@ static void share_try_cleanup(struct ssh_sharing_connstate *cs)
|
||||
if (count234(cs->halfchannels) == 0 &&
|
||||
count234(cs->channels_by_us) == 0 &&
|
||||
count234(cs->forwardings) == 0) {
|
||||
struct ssh_sharing_state *sharestate = cs->parent;
|
||||
|
||||
/*
|
||||
* Now we're _really_ done, so we can get rid of cs completely.
|
||||
*/
|
||||
del234(cs->parent->connections, cs);
|
||||
del234(sharestate->connections, cs);
|
||||
log_downstream(cs, "disconnected");
|
||||
share_connstate_free(cs);
|
||||
|
||||
/*
|
||||
* And if this was the last downstream, notify the connection
|
||||
* layer, because it might now be time to wind up the whole
|
||||
* SSH connection.
|
||||
*/
|
||||
if (count234(sharestate->connections) == 0 && sharestate->cl)
|
||||
ssh_sharing_no_more_downstreams(sharestate->cl);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user