mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
shut down HLS when client stops streaming
This commit is contained in:
13
lib/httpd.c
13
lib/httpd.c
@@ -205,6 +205,8 @@ httpd_remove_connection(httpd_t *httpd, http_connection_t *connection)
|
||||
http_request_destroy(connection->request);
|
||||
connection->request = NULL;
|
||||
}
|
||||
logger_log(httpd->logger, LOGGER_DEBUG, "removing connection type %s socket %d conn %p", typename[connection->type],
|
||||
connection->socket_fd, connection->user_data);
|
||||
httpd->callbacks.conn_destroy(connection->user_data);
|
||||
shutdown(connection->socket_fd, SHUT_WR);
|
||||
closesocket(connection->socket_fd);
|
||||
@@ -303,6 +305,17 @@ httpd_remove_known_connections(httpd_t *httpd) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
httpd_remove_connections_by_type(httpd_t *httpd, connection_type_t type) {
|
||||
for (int i = 0; i < httpd->max_connections; i++) {
|
||||
http_connection_t *connection = &httpd->connections[i];
|
||||
if (!connection->connected || connection->type != type) {
|
||||
continue;
|
||||
}
|
||||
httpd_remove_connection(httpd, connection);
|
||||
}
|
||||
}
|
||||
|
||||
static THREAD_RETVAL
|
||||
httpd_thread(void *arg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user