mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
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:
parent
73585d8eb7
commit
d7bac15719
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user