commit - 4c4167393a95834cdd3af280136c3a0a60752648
commit + 16ace04d459b77fc14ca5b14125ac955769ed72c
blob - 6da052ae5219e4a7e46f498edd6cf3576e27a35f
blob + 346333c39c7b984387caa49b05982a45eac18a26
--- gmid.c
+++ gmid.c
void
loop(struct tls *ctx, int sock)
{
- int i, todo;
+ int i;
struct client clients[MAX_USERS];
struct pollfd fds[MAX_USERS];
fds[0].fd = sock;
for (;;) {
- if ((todo = poll(fds, MAX_USERS, INFTIM)) == -1) {
+ if (poll(fds, MAX_USERS, INFTIM) == -1) {
if (errno == EINTR) {
warnx("connected clients: %d",
connected_clients);
}
for (i = 0; i < MAX_USERS; i++) {
- assert(i < MAX_USERS);
-
if (fds[i].revents == 0)
continue;
}
}
- todo--;
-
if (i == 0) { /* new client */
do_accept(sock, ctx, fds, clients);
continue;