1
0
forked from aniani/gmnisrv

Break after processing polled client

Otherwise we might not grok it, ya jive
This commit is contained in:
Drew DeVault 2020-09-27 12:11:11 -04:00
parent 7fed84898b
commit a9ee61418f

View File

@ -443,10 +443,13 @@ server_run(struct gmnisrv_server *server)
for (size_t i = 0; i < server->nclients; ++i) { for (size_t i = 0; i < server->nclients; ++i) {
if ((server->fds[server->nlisten + i].revents & (POLLHUP | POLLERR))) { if ((server->fds[server->nlisten + i].revents & (POLLHUP | POLLERR))) {
disconnect_client(server, &server->clients[i]); disconnect_client(server, &server->clients[i]);
break;
} else if ((server->fds[server->nlisten + i].revents & POLLIN)) { } else if ((server->fds[server->nlisten + i].revents & POLLIN)) {
client_readable(server, &server->clients[i]); client_readable(server, &server->clients[i]);
break;
} else if ((server->fds[server->nlisten + i].revents & POLLOUT)) { } else if ((server->fds[server->nlisten + i].revents & POLLOUT)) {
client_writable(server, &server->clients[i]); client_writable(server, &server->clients[i]);
break;
} }
} }
} while (server->run); } while (server->run);