mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 18:50:27 +09: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.
(cherry picked from commit 671a982739)
This commit is contained in:
committed by
Andreas Schneider
parent
c5990791db
commit
629cfbccc4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user