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:
committed by
Andreas Schneider
parent
4e153aed8a
commit
671a982739
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user