summaryrefslogtreecommitdiffstats
path: root/src/channels1.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-09-02 13:46:10 +0300
committerAndreas Schneider <asn@cryptomilk.org>2011-09-02 22:59:44 +0200
commit64b125700eb472787eea6dba9d2ca29d8bc360d7 (patch)
tree38bda65935a1e126b3d48b7b37e08c07d540aa9a /src/channels1.c
parent6f650a61ca67c8f799a3c3d2f0c17bdd42136e5f (diff)
channels: replaced bugged lists with ssh_list
(cherry picked from commit 6d8bb956c5caa48c2aba6713f067224650c3c1e1) Conflicts: src/channels.c src/session.c
Diffstat (limited to 'src/channels1.c')
-rw-r--r--src/channels1.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/channels1.c b/src/channels1.c
index e607b132..ad2a7c86 100644
--- a/src/channels1.c
+++ b/src/channels1.c
@@ -36,6 +36,7 @@
#include "libssh/packet.h"
#include "libssh/channels.h"
#include "libssh/session.h"
+#include "libssh/misc.h"
#ifdef WITH_SSH1
@@ -221,15 +222,17 @@ int channel_request_exec1(ssh_channel channel, const char *cmd) {
}
SSH_PACKET_CALLBACK(ssh_packet_data1){
- ssh_channel channel = session->channels;
+ ssh_channel channel;
ssh_string str = NULL;
int is_stderr=(type==SSH_SMSG_STDOUT_DATA ? 0 : 1);
+ struct ssh_iterator *it = ssh_list_get_iterator(session->channels);
(void)user;
str = buffer_get_ssh_string(packet);
if (str == NULL) {
ssh_log(session, SSH_LOG_FUNCTIONS, "Invalid data packet !\n");
return SSH_PACKET_USED;
}
+ channel = ssh_iterator_value(ssh_channel, it);
ssh_log(session, SSH_LOG_PROTOCOL,
"Adding %" PRIdS " bytes data in %d",
@@ -246,10 +249,15 @@ SSH_PACKET_CALLBACK(ssh_packet_data1){
}
SSH_PACKET_CALLBACK(ssh_packet_close1){
- ssh_channel channel = session->channels;
+ ssh_channel channel;
+ struct ssh_iterator *it = ssh_list_get_iterator(session->channels);
uint32_t status;
+
(void)type;
(void)user;
+
+ channel = ssh_iterator_value(ssh_channel, it);
+
buffer_get_u32(packet, &status);
/*
* It's much more than a channel closing. spec says it's the last