diff --git a/src/admin.c b/src/admin.c index e1823306..b4edcf12 100644 --- a/src/admin.c +++ b/src/admin.c @@ -540,7 +540,19 @@ void admin_handle_request(client_t *client, const char *uri) format = handler->format; } - handler->function(client, source, format); + switch (client->parser->req_type) { + case httpp_req_get: + handler->function(client, source, format); + break; + case httpp_req_options: + client_send_204(client); + break; + default: + ICECAST_LOG_ERROR("Wrong request type from client"); + client_send_error_by_id(client, ICECAST_ERROR_CON_UNKNOWN_REQUEST); + break; + } + if (source) { avl_tree_unlock(global.source_tree); } diff --git a/src/connection.c b/src/connection.c index dfb4b797..734aeece 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1162,15 +1162,7 @@ static void _handle_admin_request(client_t *client, char *adminuri) stats_event_inc(NULL, "client_connections"); - switch (client->parser->req_type) { - case httpp_req_get: - admin_handle_request(client, adminuri); - break; - default: - ICECAST_LOG_ERROR("Wrong request type from client"); - client_send_error_by_id(client, ICECAST_ERROR_CON_UNKNOWN_REQUEST); - break; - } + admin_handle_request(client, adminuri); } /* Handle any client that passed the authing process.