mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
channels: Fix checking for fatal errors.
We need this that we don't end up in and infinite poll loop.
This commit is contained in:
committed by
Andreas Schneider
parent
39f962c91e
commit
563fbe4de8
@@ -612,11 +612,16 @@ int ssh_poll_ctx_dopoll(ssh_poll_ctx ctx, int timeout) {
|
||||
if (!ctx->pollfds[i].revents) {
|
||||
i++;
|
||||
} else {
|
||||
int ret;
|
||||
|
||||
p = ctx->pollptrs[i];
|
||||
fd = ctx->pollfds[i].fd;
|
||||
revents = ctx->pollfds[i].revents;
|
||||
|
||||
if (p->cb && p->cb(p, fd, revents, p->cb_data) < 0) {
|
||||
if (p->cb && (ret = p->cb(p, fd, revents, p->cb_data)) < 0) {
|
||||
if (ret == -2) {
|
||||
return -1;
|
||||
}
|
||||
/* the poll was removed, reload the used counter and start again */
|
||||
used = ctx->polls_used;
|
||||
i=0;
|
||||
|
Reference in New Issue
Block a user