1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +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:
Oliver Stöneberg
2011-05-16 06:49:38 -07:00
committed by Andreas Schneider
parent 4e153aed8a
commit 671a982739
3 changed files with 9 additions and 8 deletions

View File

@@ -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) {