From 671a9827394714cfc90d75c8a8fb2ccd86f80abf Mon Sep 17 00:00:00 2001 From: Oliver Stöneberg Date: Mon, 16 May 2011 06:49:38 -0700 Subject: 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. --- src/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/session.c') diff --git a/src/session.c b/src/session.c index 18688c6..35fb0b2 100644 --- a/src/session.c +++ b/src/session.c @@ -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; -- cgit