From 3407509ed72a9b387187e91e9a5274b5ef39bb88 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 24 Jan 2010 23:03:56 +0100 Subject: Correctly handle channel failures and chan states --- include/libssh/channels.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libssh/channels.h b/include/libssh/channels.h index 5e4901ba..56e660fc 100644 --- a/include/libssh/channels.h +++ b/include/libssh/channels.h @@ -40,6 +40,13 @@ enum ssh_channel_request_state_e { SSH_CHANNEL_REQ_STATE_ERROR }; +enum ssh_channel_state_e { + SSH_CHANNEL_STATE_NOT_OPEN = 0, + SSH_CHANNEL_STATE_OPEN_DENIED, + SSH_CHANNEL_STATE_OPEN, + SSH_CHANNEL_STATE_CLOSED +}; + struct ssh_channel_struct { struct ssh_channel_struct *prev; struct ssh_channel_struct *next; @@ -53,7 +60,7 @@ struct ssh_channel_struct { uint32_t remote_window; int remote_eof; /* end of file received */ uint32_t remote_maxpacket; - int open; /* shows if the channel is still opened */ + enum ssh_channel_state_e state; int delayed_close; ssh_buffer stdout_buffer; ssh_buffer stderr_buffer; -- cgit