aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/channels.h
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-08-28 14:27:24 +0300
committerAris Adamantiadis <aris@0xbadc0de.be>2011-09-02 13:50:06 +0300
commitef5701a5357e3f5b71aa5c387e4f976fe5df0ab7 (patch)
treef8a6b0418e739b3aefc2e880692589fca4cd28e6 /include/libssh/channels.h
parent7d347aa6f42c1698629f89e4ae7155348a6df8d4 (diff)
downloadlibssh-ef5701a5357e3f5b71aa5c387e4f976fe5df0ab7.tar.gz
libssh-ef5701a5357e3f5b71aa5c387e4f976fe5df0ab7.tar.xz
libssh-ef5701a5357e3f5b71aa5c387e4f976fe5df0ab7.zip
Channels: fix the "server specified invalid channel" bug
Resolved by introducing a flag entry in channel structure.
Diffstat (limited to 'include/libssh/channels.h')
-rw-r--r--include/libssh/channels.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/libssh/channels.h b/include/libssh/channels.h
index 624a3adf..87415e5f 100644
--- a/include/libssh/channels.h
+++ b/include/libssh/channels.h
@@ -48,6 +48,13 @@ enum ssh_channel_state_e {
SSH_CHANNEL_STATE_CLOSED
};
+/* The channel has been closed by the remote side */
+#define SSH_CHANNEL_FLAG_CLOSED_REMOTE 0x1
+/* The channel has been freed by the calling program */
+#define SSH_CHANNEL_FLAG_FREED_LOCAL 0x2
+/* the channel has not yet been bound to a remote one */
+#define SSH_CHANNEL_FLAG_NOT_BOUND 0x4
+
struct ssh_channel_struct {
ssh_session session; /* SSH_SESSION pointer */
uint32_t local_channel;
@@ -61,6 +68,7 @@ struct ssh_channel_struct {
uint32_t remote_maxpacket;
enum ssh_channel_state_e state;
int delayed_close;
+ int flags;
ssh_buffer stdout_buffer;
ssh_buffer stderr_buffer;
void *userarg;
@@ -90,6 +98,7 @@ uint32_t ssh_channel_new_id(ssh_session session);
ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id);
int channel_write_common(ssh_channel channel, const void *data,
uint32_t len, int is_stderr);
+void ssh_channel_do_free(ssh_channel channel);
#ifdef WITH_SSH1
SSH_PACKET_CALLBACK(ssh_packet_data1);
SSH_PACKET_CALLBACK(ssh_packet_close1);