summaryrefslogtreecommitdiffstats
path: root/src/poll.c
diff options
context:
space:
mode:
authorOliver Stöneberg <oliverst@online.de>2011-05-16 06:49:38 -0700
committerAndreas Schneider <asn@cryptomilk.org>2011-05-17 14:21:04 +0200
commit671a9827394714cfc90d75c8a8fb2ccd86f80abf (patch)
tree1dfceab719c98de0c89d663914b8d159da3e8b72 /src/poll.c
parent4e153aed8a943b636135b424e052fc69392ad87c (diff)
downloadlibssh-671a9827394714cfc90d75c8a8fb2ccd86f80abf.tar.gz
libssh-671a9827394714cfc90d75c8a8fb2ccd86f80abf.tar.xz
libssh-671a9827394714cfc90d75c8a8fb2ccd86f80abf.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.
Diffstat (limited to 'src/poll.c')
-rw-r--r--src/poll.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/poll.c b/src/poll.c
index 5faef06d..007dc019 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -645,10 +645,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) {