-/* $OpenBSD: http.c,v 1.23 2021/04/08 16:46:59 claudio Exp $ */
+/* $OpenBSD: http.c,v 1.24 2021/04/08 16:56:34 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
err(1, "write");
}
}
+ for (i = 0; i < MAX_CONNECTIONS; i++) {
+ struct http_connection *conn = http_conns[i];
+
+ if (conn == NULL)
+ continue;
+ /* event not ready */
+ if (!(pfds[i].revents & (conn->events | POLLHUP)))
+ continue;
+
+ if (http_do(conn) == -1)
+ http_conns[i] = NULL;
+ }
if (pfds[MAX_CONNECTIONS].revents & POLLIN) {
struct http_connection *h;
size_t id;
}
}
}
- for (i = 0; i < MAX_CONNECTIONS; i++) {
- struct http_connection *conn = http_conns[i];
-
- if (conn == NULL)
- continue;
- /* event not ready */
- if (!(pfds[i].revents & (conn->events | POLLHUP)))
- continue;
-
- if (http_do(conn) == -1)
- http_conns[i] = NULL;
- }
}
exit(0);