mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-15 01:39:39 +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:
|
pending:
|
||||||
/* wait until channel is opened by server */
|
/* wait until channel is opened by server */
|
||||||
err = ssh_handle_packets_termination(session, SSH_TIMEOUT_USER, ssh_channel_open_termination, channel);
|
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;
|
err = SSH_ERROR;
|
||||||
end:
|
end:
|
||||||
if(channel->state == SSH_CHANNEL_STATE_OPEN)
|
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);
|
ret = ssh_handle_packets(session, tm);
|
||||||
if(ret == SSH_ERROR)
|
if(ret == SSH_ERROR)
|
||||||
break;
|
break;
|
||||||
if(ssh_timeout_elapsed(&ts,timeout))
|
if(ssh_timeout_elapsed(&ts,timeout)) {
|
||||||
|
ret = fct(user) ? SSH_OK : SSH_AGAIN;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
tm = ssh_timeout_update(&ts, timeout);
|
tm = ssh_timeout_update(&ts, timeout);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user