mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Implement killsource admin command, to kill sources. Doesn't always do much,
ices (as an example) will auto-reconnect. svn path=/trunk/icecast/; revision=4571
This commit is contained in:
parent
ed019c0cd6
commit
81cd2d50f5
14
src/admin.c
14
src/admin.c
@ -34,6 +34,7 @@
|
||||
|
||||
/* Client management commands */
|
||||
#define COMMAND_KILL_CLIENT 201
|
||||
#define COMMAND_KILL_SOURCE 202
|
||||
|
||||
int admin_get_command(char *command)
|
||||
{
|
||||
@ -55,6 +56,8 @@ int admin_get_command(char *command)
|
||||
return COMMAND_MOVE_CLIENTS;
|
||||
else if(!strcmp(command, "killclient"))
|
||||
return COMMAND_KILL_CLIENT;
|
||||
else if(!strcmp(command, "killsource"))
|
||||
return COMMAND_KILL_SOURCE;
|
||||
else
|
||||
return COMMAND_ERROR;
|
||||
}
|
||||
@ -68,6 +71,7 @@ static void command_raw_stats(client_t *client);
|
||||
static void command_list_mounts(client_t *client, int formatted);
|
||||
|
||||
static void command_kill_client(client_t *client, source_t *source);
|
||||
static void command_kill_source(client_t *client, source_t *source);
|
||||
|
||||
static void admin_handle_mount_request(client_t *client, source_t *source,
|
||||
int command);
|
||||
@ -177,6 +181,9 @@ static void admin_handle_mount_request(client_t *client, source_t *source,
|
||||
case COMMAND_KILL_CLIENT:
|
||||
command_kill_client(client, source);
|
||||
break;
|
||||
case COMMAND_KILL_SOURCE:
|
||||
command_kill_source(client, source);
|
||||
break;
|
||||
default:
|
||||
WARN0("Mount request not recognised");
|
||||
client_send_400(client, "Mount request unknown");
|
||||
@ -300,6 +307,13 @@ static void command_show_listeners(client_t *client, source_t *source)
|
||||
client_destroy(client);
|
||||
}
|
||||
|
||||
static void command_kill_source(client_t *client, source_t *source)
|
||||
{
|
||||
source->running = 0;
|
||||
|
||||
html_success(client, "Removing source");
|
||||
}
|
||||
|
||||
static void command_kill_client(client_t *client, source_t *source)
|
||||
{
|
||||
char *idtext;
|
||||
|
@ -597,7 +597,7 @@ void *source_main(void *arg)
|
||||
|
||||
done:
|
||||
|
||||
DEBUG0("Source exiting");
|
||||
INFO1("Source \"%s\" exiting", source->mount);
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
if(!suppress_yp) {
|
||||
|
Loading…
Reference in New Issue
Block a user