Remove keep-alive optimization from httpd_poll

Benchmarking with `ab` shows that bypassing `select` for keep-alive
connections in the `DONE` state doesn't significantly impact
performance. Since this optimization previously caused a bug, remove it.
This commit is contained in:
Tom Dryer 2021-06-13 13:58:43 -07:00
parent 73585d8eb7
commit d7bac15719

View File

@ -2576,19 +2576,14 @@ static void httpd_poll(void) {
}
/* Handling SEND_REPLY could have set the state to done. */
while (conn->state == DONE) {
if (conn->state == DONE) {
/* clean out finished connection */
if (conn->conn_close) {
LIST_REMOVE(conn, entries);
free_connection(conn);
free(conn);
break;
} else {
recycle_connection(conn);
/* and go right back to recv_request without going through
* select() again, until state is not DONE
*/
poll_recv_request(conn);
}
}
}