diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-12-10 14:55:13 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-12-10 17:50:17 +0100 |
commit | bcdbc11732c495b4b1554d7f537ac992fab21107 (patch) | |
tree | d5ac09b9c9ab2b1aaae7c14d4f565662b0e59348 | |
parent | 79289dc5069b914ad6cf67f7723c2c56707a2029 (diff) | |
download | libssh-bcdbc11732c495b4b1554d7f537ac992fab21107.tar.gz libssh-bcdbc11732c495b4b1554d7f537ac992fab21107.tar.xz libssh-bcdbc11732c495b4b1554d7f537ac992fab21107.zip |
channel: Add SSH_CHANNEL_FLAG_CLOSED_LOCAL
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 13b9d268d42b7c34aa5e3e468b53d9735f3d10fb)
-rw-r--r-- | include/libssh/channels.h | 11 | ||||
-rw-r--r-- | src/channels.c | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/libssh/channels.h b/include/libssh/channels.h index 343aa7f7..fc03965a 100644 --- a/include/libssh/channels.h +++ b/include/libssh/channels.h @@ -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 */ diff --git a/src/channels.c b/src/channels.c index 65ac28d9..3147f5ff 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1164,6 +1164,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); |