1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

connect: Set timeout on connect

This also fixes error handling in ssh_poll_ctx_dopoll() and
ssh_handle_packets(), so it won't loop forever on an actual timeout.
This commit is contained in:
Oliver Stöneberg
2011-05-16 06:49:38 -07:00
committed by Andreas Schneider
parent 4e153aed8a
commit 671a982739
3 changed files with 9 additions and 8 deletions

View File

@@ -429,7 +429,8 @@ int ssh_handle_packets(ssh_session session, int timeout) {
if(spoll_in != spoll_out)
ssh_poll_ctx_add(ctx,spoll_out);
}
ssh_poll_ctx_dopoll(ctx,timeout);
if( ssh_poll_ctx_dopoll(ctx,timeout) )
session->session_state = SSH_SESSION_STATE_ERROR;
leave_function();
if (session->session_state != SSH_SESSION_STATE_ERROR)
return SSH_OK;