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:
@@ -2171,8 +2171,21 @@ static void httpd_poll(void)
|
|||||||
poll_check_timeout(conn);
|
poll_check_timeout(conn);
|
||||||
switch (conn->state)
|
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:
|
case RECV_REQUEST:
|
||||||
recv_request:
|
|
||||||
MAX_FD_SET(conn->socket, &recv_set);
|
MAX_FD_SET(conn->socket, &recv_set);
|
||||||
bother_with_timeout = 1;
|
bother_with_timeout = 1;
|
||||||
break;
|
break;
|
||||||
@@ -2183,22 +2196,6 @@ static void httpd_poll(void)
|
|||||||
bother_with_timeout = 1;
|
bother_with_timeout = 1;
|
||||||
break;
|
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");
|
default: errx(1, "invalid state");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user