From a7d9f4addd2e12e4b827cb2a262845503041699f Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 19 Jul 2010 22:50:15 +0200 Subject: [PATCH] Correctly handle failed opened channels --- libssh/channels.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libssh/channels.c b/libssh/channels.c index a0355796..0a7e5780 100644 --- a/libssh/channels.c +++ b/libssh/channels.c @@ -165,8 +165,10 @@ static int channel_open(ssh_channel channel, const char *type_c, int window, type_c, channel->local_channel); if (packet_wait(session, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, 1) != SSH_OK) { - leave_function(); - return -1; + if(session->in_packet.type != SSH2_MSG_CHANNEL_OPEN_FAILURE) { + leave_function(); + return -1; + } } switch(session->in_packet.type) {