diff options
author | Oliver Stöneberg <oliverst@online.de> | 2011-05-16 06:49:38 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-05-17 20:57:38 +0200 |
commit | 629cfbccc44da2a3eda66ec665d2f98ad93be0b6 (patch) | |
tree | 3b5582c9205429645f04f36edbdb9a5f827864c5 /src/poll.c | |
parent | c5990791db48521f9e9271b65110eb6ebb2820eb (diff) | |
download | libssh-629cfbccc44da2a3eda66ec665d2f98ad93be0b6.tar.gz libssh-629cfbccc44da2a3eda66ec665d2f98ad93be0b6.tar.xz libssh-629cfbccc44da2a3eda66ec665d2f98ad93be0b6.zip |
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)
Diffstat (limited to 'src/poll.c')
-rw-r--r-- | src/poll.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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) { |