channel: Add SSH_CHANNEL_FLAG_CLOSED_LOCAL

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-12-10 14:55:13 +01:00
parent 0ba10870d1
commit 13b9d268d4
2 changed files with 9 additions and 3 deletions

View File

@@ -48,11 +48,16 @@ enum ssh_channel_state_e {
};
/* The channel has been closed by the remote side */
#define SSH_CHANNEL_FLAG_CLOSED_REMOTE 0x1
#define SSH_CHANNEL_FLAG_CLOSED_REMOTE 0x0001
/* The channel has been closed locally */
#define SSH_CHANNEL_FLAG_CLOSED_LOCAL 0x0002
/* The channel has been freed by the calling program */
#define SSH_CHANNEL_FLAG_FREED_LOCAL 0x2
#define SSH_CHANNEL_FLAG_FREED_LOCAL 0x0004
/* the channel has not yet been bound to a remote one */
#define SSH_CHANNEL_FLAG_NOT_BOUND 0x4
#define SSH_CHANNEL_FLAG_NOT_BOUND 0x0008
struct ssh_channel_struct {
ssh_session session; /* SSH_SESSION pointer */

View File

@@ -1172,6 +1172,7 @@ int ssh_channel_close(ssh_channel channel)
if (rc == SSH_OK) {
channel->state = SSH_CHANNEL_STATE_CLOSED;
channel->flags |= SSH_CHANNEL_FLAG_CLOSED_LOCAL;
}
rc = ssh_channel_flush(channel);