[xiph-cvs] cvs commit: icecast/src event.c slave.c slave.h

Karl Heyes karl at xiph.org
Mon Feb 2 11:22:13 PST 2004



karl        04/02/02 14:22:13

  Modified:    src      event.c slave.c slave.h
  Log:
  recheck the relays after the HUP has been handled

Revision  Changes    Path
1.7       +2 -0      icecast/src/event.c

Index: event.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/event.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- event.c	29 Jan 2004 01:02:06 -0000	1.6
+++ event.c	2 Feb 2004 19:22:11 -0000	1.7
@@ -21,6 +21,7 @@
 #include "refbuf.h"
 #include "client.h"
 #include "logging.h"
+#include "slave.h"
 
 #define CATMODULE "event"
 
@@ -57,6 +58,7 @@
         config_clear(config);
         config_set_config(&new_config);
         restart_logging ();
+        slave_recheck();
         yp_recheck_config (config);
 
         config_release_config();

<p><p>1.32      +10 -9     icecast/src/slave.c

Index: slave.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/slave.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- slave.c	29 Jan 2004 01:02:06 -0000	1.31
+++ slave.c	2 Feb 2004 19:22:11 -0000	1.32
@@ -62,6 +62,14 @@
 static void *_slave_thread(void *arg);
 thread_type *_slave_thread_id;
 static int _initialized = 0;
+static unsigned max_interval = 0;
+
+
+void slave_recheck (void)
+{
+    max_interval = 0;
+}
+
 
 void slave_initialize(void) {
     ice_config_t *config;
@@ -150,19 +158,12 @@
 static void *_slave_thread(void *arg) {
     sock_t mastersock;
     char buf[256];
-    int interval;
+    unsigned interval = 0;
     char *authheader, *data;
     int len;
     char *username = "relay";
-    int max_interval;
     relay_server *relay;
     ice_config_t *config;
-    
-    config = config_get_config();
-
-    interval = max_interval = config->master_update_interval;
-
-    config_release_config();
 
     while (_initialized) {
         if (max_interval > ++interval) {
@@ -252,7 +253,7 @@
 
         thread_mutex_unlock(&(config_locks()->relay_lock));
     }
-    thread_exit(0);
+    INFO0 ("Slave thread shutting down");
     return NULL;
 }
 

<p><p>1.3       +1 -0      icecast/src/slave.h

Index: slave.h
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/slave.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- slave.h	29 Jan 2004 01:02:06 -0000	1.2
+++ slave.h	2 Feb 2004 19:22:11 -0000	1.3
@@ -15,5 +15,6 @@
 
 void slave_initialize(void);
 void slave_shutdown(void);
+void slave_recheck (void);
 
 #endif  /* __SLAVE_H__ */

<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