summaryrefslogtreecommitdiff
path: root/channel.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-11-14 22:57:56 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-11-14 22:57:56 +0800
commit0457a76da104e49d0d3053ead9966655f633ff46 (patch)
treed0781a94f6f10e9c9b6ba0c48bd9d2b36030290b /channel.h
parent8d38abefa1d8de996644e6891000821e0738ba54 (diff)
downloaddropbear-0457a76da104e49d0d3053ead9966655f633ff46.tar.gz
Split ChanType closehandler() and cleanup() so that dbclient doesn't
lose exit status messages
Diffstat (limited to 'channel.h')
-rw-r--r--channel.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/channel.h b/channel.h
index c6c4fda..557d889 100644
--- a/channel.h
+++ b/channel.h
@@ -69,10 +69,6 @@ struct Channel {
int sent_close, recv_close;
int recv_eof, sent_eof;
- /* Set after running the ChanType-specific close hander
- * to ensure we don't run it twice (nor type->checkclose()). */
- int close_handler_done;
-
struct dropbear_progress_connection *conn_pending;
int initconn; /* used for TCP forwarding, whether the channel has been
fully initialised */
@@ -95,10 +91,17 @@ struct ChanType {
int sepfds; /* Whether this channel has separate pipes for in/out or not */
const char *name;
+ /* Sets up the channel */
int (*inithandler)(struct Channel*);
+ /* Called to check whether a channel should close, separately from the FD being closed.
+ Used for noticing process exiting */
int (*check_close)(const struct Channel*);
+ /* Handler for ssh_msg_channel_request */
void (*reqhandler)(struct Channel*);
+ /* Called prior to sending ssh_msg_channel_close, used for sending exit status */
void (*closehandler)(const struct Channel*);
+ /* Frees resources, called just prior to channel being removed */
+ void (*cleanup)(const struct Channel*);
};
/* Callback for connect_remote */