Skip to content

Commit

Permalink
Only handle one event per connection per iteration, since one event h…
Browse files Browse the repository at this point in the history
…andler might close the connection before the next one runs.
  • Loading branch information
dag-erling committed Nov 3, 2016
1 parent e092017 commit 36d1439
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/kexkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,11 @@ kexkill(struct sockaddr *sa, socklen_t salen)
for (i = 0; i < maxconns; ++i) {
if (pfd[i].fd == 0)
continue;
if (pfd[i].revents & (POLLERR|POLLHUP)) {
else if (pfd[i].revents & (POLLERR|POLLHUP))
kk_hup(&conns[i]);
continue;
}
if (pfd[i].revents & POLLIN)
else if (pfd[i].revents & POLLIN)
kk_input(&conns[i]);
if (pfd[i].revents & POLLOUT)
else if (pfd[i].revents & POLLOUT)
kk_output(&conns[i]);
}
}
Expand Down

0 comments on commit 36d1439

Please sign in to comment.