mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Use FALLTHROUGH instead of goto.
This commit is contained in:
parent
1623dee16a
commit
84e59c72ac
@ -2171,8 +2171,21 @@ static void httpd_poll(void)
|
||||
poll_check_timeout(conn);
|
||||
switch (conn->state)
|
||||
{
|
||||
case DONE:
|
||||
/* clean out stale connections while we're at it */
|
||||
if (conn->conn_close)
|
||||
{
|
||||
LIST_REMOVE(conn, entries);
|
||||
free_connection(conn);
|
||||
safefree(conn);
|
||||
break;
|
||||
}
|
||||
/* else */
|
||||
recycle_connection(conn);
|
||||
/* And enqueue as RECV_REQUEST. */
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case RECV_REQUEST:
|
||||
recv_request:
|
||||
MAX_FD_SET(conn->socket, &recv_set);
|
||||
bother_with_timeout = 1;
|
||||
break;
|
||||
@ -2183,22 +2196,6 @@ static void httpd_poll(void)
|
||||
bother_with_timeout = 1;
|
||||
break;
|
||||
|
||||
case DONE:
|
||||
/* clean out stale connections while we're at it */
|
||||
if (conn->conn_close)
|
||||
{
|
||||
LIST_REMOVE(conn, entries);
|
||||
free_connection(conn);
|
||||
safefree(conn);
|
||||
}
|
||||
else
|
||||
{
|
||||
recycle_connection(conn);
|
||||
/* And enqueue as RECV_REQUEST. */
|
||||
goto recv_request;
|
||||
}
|
||||
break;
|
||||
|
||||
default: errx(1, "invalid state");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user