mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Allow channels not to close immediately after two EOFs.
Some kinds of channel, even after they've sent EOF in both directions, still have something to do before they initiate the CLOSE mechanism and wind up the channel completely. For example, a session channel with a subprocess running inside it will want to be sure to send the "exit-status" or "exit-signal" notification, even if that happens after bidirectional EOF of the data channels. Previously, the SSH-2 connection layer had the standard policy that once EOF had been both sent and received, it would start the final close procedure. There's a method chan_want_close() by which a Channel could vary this policy in one direction, by indicating that it wanted the close procedure to commence after EOF was sent in only one direction. Its parameters are a pair of booleans saying whether EOF has been sent, and whether it's been received. Now chan_want_close can vary the policy in the other direction as well: if it returns FALSE even when _both_ parameters are true, the connection layer will honour that, and not send CHANNEL_CLOSE. If it does that, the Channel is responsible for indicating when it _does_ want close later, by calling sshfwd_initiate_close.
This commit is contained in:
@ -124,7 +124,7 @@ static int time_to_die = FALSE;
|
||||
* forwarding too. */
|
||||
void chan_remotely_opened_confirmation(Channel *chan) { }
|
||||
void chan_remotely_opened_failure(Channel *chan, const char *err) { }
|
||||
int chan_no_eager_close(Channel *chan, int s, int r) { return FALSE; }
|
||||
int chan_default_want_close(Channel *chan, int s, int r) { return FALSE; }
|
||||
int chan_no_exit_status(Channel *ch, int s) { return FALSE; }
|
||||
int chan_no_exit_signal(Channel *ch, ptrlen s, int c, ptrlen m)
|
||||
{ return FALSE; }
|
||||
|
Reference in New Issue
Block a user