From 629cfbccc44da2a3eda66ec665d2f98ad93be0b6 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. (cherry picked from commit 671a9827394714cfc90d75c8a8fb2ccd86f80abf) --- src/poll.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/poll.c') diff --git a/src/poll.c b/src/poll.c index 07b0d531..e5a11d95 100644 --- a/src/poll.c +++ b/src/poll.c @@ -598,10 +598,8 @@ int ssh_poll_ctx_dopoll(ssh_poll_ctx ctx, int timeout) { return 0; rc = ssh_poll(ctx->pollfds, ctx->polls_used, timeout); - if(rc < 0) - rc=SSH_ERROR; if(rc <= 0) - return rc; + return SSH_ERROR; used = ctx->polls_used; for (i = 0; i < used && rc > 0; ) { if (!ctx->pollfds[i].revents) { -- cgit