channels: Handle SSH_AGAIN in channel_open().
Этот коммит содержится в:
родитель
6c45d6dc01
Коммит
2f87873642
@ -296,11 +296,14 @@ static int channel_open(ssh_channel channel, const char *type_c, int window,
|
||||
/* Todo: fix this into a correct loop */
|
||||
/* wait until channel is opened by server */
|
||||
while(channel->state == SSH_CHANNEL_STATE_NOT_OPEN){
|
||||
ssh_handle_packets(session, -2);
|
||||
if (session->session_state == SSH_SESSION_STATE_ERROR) {
|
||||
err = SSH_ERROR;
|
||||
break;
|
||||
}
|
||||
err = ssh_handle_packets(session, -2);
|
||||
if (err != SSH_OK) {
|
||||
break;
|
||||
}
|
||||
if (session->session_state == SSH_SESSION_STATE_ERROR) {
|
||||
err = SSH_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(channel->state == SSH_CHANNEL_STATE_OPEN)
|
||||
err=SSH_OK;
|
||||
|
@ -464,18 +464,12 @@ int ssh_handle_packets(ssh_session session, int timeout) {
|
||||
tm = ssh_make_milliseconds(session->timeout, session->timeout_usec);
|
||||
}
|
||||
rc = ssh_poll_ctx_dopoll(ctx, tm);
|
||||
|
||||
if (rc == SSH_ERROR) {
|
||||
session->session_state = SSH_SESSION_STATE_ERROR;
|
||||
}
|
||||
|
||||
leave_function();
|
||||
|
||||
if (session->session_state == SSH_SESSION_STATE_ERROR) {
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
return SSH_OK;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user