mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-08 06:20:14 +01:00
[libssh] bug fix in channel_open()
This commit is contained in:
parent
8131143fa8
commit
7cdb1e2016
@ -314,7 +314,7 @@ static int channel_open(ssh_channel channel, const char *type_c, int window,
|
||||
pending:
|
||||
/* wait until channel is opened by server */
|
||||
err = ssh_handle_packets_termination(session, SSH_TIMEOUT_USER, ssh_channel_open_termination, channel);
|
||||
if (err != SSH_OK || session->session_state == SSH_SESSION_STATE_ERROR)
|
||||
if (session->session_state == SSH_SESSION_STATE_ERROR)
|
||||
err = SSH_ERROR;
|
||||
end:
|
||||
if(channel->state == SSH_CHANNEL_STATE_OPEN)
|
||||
|
@ -537,8 +537,10 @@ int ssh_handle_packets_termination(ssh_session session, int timeout,
|
||||
ret = ssh_handle_packets(session, tm);
|
||||
if(ret == SSH_ERROR)
|
||||
break;
|
||||
if(ssh_timeout_elapsed(&ts,timeout))
|
||||
if(ssh_timeout_elapsed(&ts,timeout)) {
|
||||
ret = fct(user) ? SSH_OK : SSH_AGAIN;
|
||||
break;
|
||||
}
|
||||
tm = ssh_timeout_update(&ts, timeout);
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user