mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
channels: Fix an endless loop in case of a channel_open error.
(cherry picked from commit 7ccd9c31b3)
This commit is contained in:
committed by
Andreas Schneider
parent
61a97ccede
commit
b542bc9e4e
@@ -293,6 +293,10 @@ static int channel_open(ssh_channel channel, const char *type_c, int window,
|
|||||||
/* wait until channel is opened by server */
|
/* wait until channel is opened by server */
|
||||||
while(channel->state == SSH_CHANNEL_STATE_NOT_OPEN){
|
while(channel->state == SSH_CHANNEL_STATE_NOT_OPEN){
|
||||||
ssh_handle_packets(session, -2);
|
ssh_handle_packets(session, -2);
|
||||||
|
if (session->session_state == SSH_SESSION_STATE_ERROR) {
|
||||||
|
err = SSH_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(channel->state == SSH_CHANNEL_STATE_OPEN)
|
if(channel->state == SSH_CHANNEL_STATE_OPEN)
|
||||||
err=SSH_OK;
|
err=SSH_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user