Correctly handle failed opened channels

This commit is contained in:
Aris Adamantiadis
2010-07-19 22:50:15 +02:00
parent a4f4fa3058
commit a7d9f4addd

View File

@@ -165,8 +165,10 @@ static int channel_open(ssh_channel channel, const char *type_c, int window,
type_c, channel->local_channel); type_c, channel->local_channel);
if (packet_wait(session, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, 1) != SSH_OK) { if (packet_wait(session, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, 1) != SSH_OK) {
leave_function(); if(session->in_packet.type != SSH2_MSG_CHANNEL_OPEN_FAILURE) {
return -1; leave_function();
return -1;
}
} }
switch(session->in_packet.type) { switch(session->in_packet.type) {