[xiph-cvs] cvs commit: icecast/src admin.c source.c

Michael Smith msmith at xiph.org
Mon Mar 31 04:54:44 PST 2003



msmith      03/03/31 07:54:44

  Modified:    src      admin.c source.c
  Log:
  Implement killsource admin command, to kill sources. Doesn't always do much,
  ices (as an example) will auto-reconnect.

Revision  Changes    Path
1.8       +14 -0     icecast/src/admin.c

Index: admin.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/admin.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- admin.c	30 Mar 2003 13:52:27 -0000	1.7
+++ admin.c	31 Mar 2003 12:54:44 -0000	1.8
@@ -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 @@
         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_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 @@
         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");
@@ -298,6 +305,13 @@
     html_write(client, "</table></body></html>");
 
     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)

<p><p>1.49      +1 -1      icecast/src/source.c

Index: source.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/source.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- source.c	30 Mar 2003 13:52:27 -0000	1.48
+++ source.c	31 Mar 2003 12:54:44 -0000	1.49
@@ -597,7 +597,7 @@
 
 done:
 
-    DEBUG0("Source exiting");
+    INFO1("Source \"%s\" exiting", source->mount);
 
 #ifdef HAVE_CURL
     if(!suppress_yp) {

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list