From 783f03d5ede052ad03c5311974e532609a0a7fa3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 19 Sep 2018 20:32:27 +0100 Subject: [PATCH] Move the default Channel methods into sshcommon.c. Those don't need any of ssh.c's internal facilities either. --- ssh.c | 15 --------------- sshcommon.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ssh.c b/ssh.c index 17e9075d..7a2b26fa 100644 --- a/ssh.c +++ b/ssh.c @@ -1342,21 +1342,6 @@ static void ssh_process_user_input(void *ctx) ssh->current_user_input_fn(ssh); } -void chan_remotely_opened_confirmation(Channel *chan) -{ - assert(0 && "this channel type should never receive OPEN_CONFIRMATION"); -} - -void chan_remotely_opened_failure(Channel *chan, const char *errtext) -{ - assert(0 && "this channel type should never receive OPEN_FAILURE"); -} - -int chan_no_eager_close(Channel *chan, int sent_local_eof, int rcvd_remote_eof) -{ - return FALSE; /* default: never proactively ask for a close */ -} - static int ssh_do_close(Ssh ssh, int notify_exit) { int ret = 0; diff --git a/sshcommon.c b/sshcommon.c index 8bab9beb..ec471544 100644 --- a/sshcommon.c +++ b/sshcommon.c @@ -267,3 +267,22 @@ static int zombiechan_want_close(Channel *chan, int sent_eof, int rcvd_eof) return TRUE; } +/* ---------------------------------------------------------------------- + * Centralised standard methods for other channel implementations to + * borrow. + */ + +void chan_remotely_opened_confirmation(Channel *chan) +{ + assert(0 && "this channel type should never receive OPEN_CONFIRMATION"); +} + +void chan_remotely_opened_failure(Channel *chan, const char *errtext) +{ + assert(0 && "this channel type should never receive OPEN_FAILURE"); +} + +int chan_no_eager_close(Channel *chan, int sent_local_eof, int rcvd_remote_eof) +{ + return FALSE; /* default: never proactively ask for a close */ +}