1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

session: Use defines for ssh_handle_packets().

This commit is contained in:
Andreas Schneider
2011-09-17 10:37:16 +02:00
parent 544747d02c
commit afa56e0102
4 changed files with 10 additions and 6 deletions

View File

@@ -157,7 +157,7 @@ int channel_change_pty_size1(ssh_channel channel, int cols, int rows) {
ssh_log(session, SSH_LOG_PROTOCOL, "Change pty size send"); ssh_log(session, SSH_LOG_PROTOCOL, "Change pty size send");
while(channel->request_state==SSH_CHANNEL_REQ_STATE_PENDING){ while(channel->request_state==SSH_CHANNEL_REQ_STATE_PENDING){
ssh_handle_packets(session,-1); ssh_handle_packets(session, SSH_TIMEOUT_INFINITE);
} }
switch(channel->request_state){ switch(channel->request_state){
case SSH_CHANNEL_REQ_STATE_ERROR: case SSH_CHANNEL_REQ_STATE_ERROR:

View File

@@ -687,8 +687,12 @@ pending:
session->session_state = SSH_SESSION_STATE_ERROR; session->session_state = SSH_SESSION_STATE_ERROR;
} }
} }
else else {
ssh_handle_packets_termination(session, 0, ssh_connect_termination, session); ssh_handle_packets_termination(session,
SSH_TIMEOUT_NONBLOCKING,
ssh_connect_termination,
session);
}
ssh_log(session,SSH_LOG_PACKET,"ssh_connect: Actual state : %d",session->session_state); ssh_log(session,SSH_LOG_PACKET,"ssh_connect: Actual state : %d",session->session_state);
if(!ssh_is_blocking(session) && !ssh_connect_termination(session)){ if(!ssh_is_blocking(session) && !ssh_connect_termination(session)){
leave_function(); leave_function();

View File

@@ -471,14 +471,14 @@ int ssh_get_kex1(ssh_session session) {
ssh_log(session, SSH_LOG_PROTOCOL, "Waiting for a SSH_SMSG_PUBLIC_KEY"); ssh_log(session, SSH_LOG_PROTOCOL, "Waiting for a SSH_SMSG_PUBLIC_KEY");
/* Here the callback is called */ /* Here the callback is called */
while(session->session_state==SSH_SESSION_STATE_INITIAL_KEX){ while(session->session_state==SSH_SESSION_STATE_INITIAL_KEX){
ssh_handle_packets(session, -2); ssh_handle_packets(session, SSH_TIMEOUT_USER);
} }
if(session->session_state==SSH_SESSION_STATE_ERROR) if(session->session_state==SSH_SESSION_STATE_ERROR)
goto error; goto error;
ssh_log(session, SSH_LOG_PROTOCOL, "Waiting for a SSH_SMSG_SUCCESS"); ssh_log(session, SSH_LOG_PROTOCOL, "Waiting for a SSH_SMSG_SUCCESS");
/* Waiting for SSH_SMSG_SUCCESS */ /* Waiting for SSH_SMSG_SUCCESS */
while(session->session_state==SSH_SESSION_STATE_KEXINIT_RECEIVED){ while(session->session_state==SSH_SESSION_STATE_KEXINIT_RECEIVED){
ssh_handle_packets(session, -2); ssh_handle_packets(session, SSH_TIMEOUT_USER);
} }
if(session->session_state==SSH_SESSION_STATE_ERROR) if(session->session_state==SSH_SESSION_STATE_ERROR)
goto error; goto error;

View File

@@ -1081,7 +1081,7 @@ void ssh_set_message_callback(ssh_session session,
int ssh_execute_message_callbacks(ssh_session session){ int ssh_execute_message_callbacks(ssh_session session){
ssh_message msg=NULL; ssh_message msg=NULL;
int ret; int ret;
ssh_handle_packets(session, 0); ssh_handle_packets(session, SSH_TIMEOUT_NONBLOCKING);
if(!session->ssh_message_list) if(!session->ssh_message_list)
return SSH_OK; return SSH_OK;
if(session->ssh_message_callback){ if(session->ssh_message_callback){