[xiph-commits] r16298 - in icecast/branches/kh/icecast: . src win32

karl at svn.xiph.org karl at svn.xiph.org
Fri Jul 17 18:47:06 PDT 2009


Author: karl
Date: 2009-07-17 18:47:06 -0700 (Fri, 17 Jul 2009)
New Revision: 16298

Modified:
   icecast/branches/kh/icecast/NEWS
   icecast/branches/kh/icecast/config.h.vc6
   icecast/branches/kh/icecast/configure.in
   icecast/branches/kh/icecast/src/client.h
   icecast/branches/kh/icecast/src/fserve.c
   icecast/branches/kh/icecast/src/slave.c
   icecast/branches/kh/icecast/src/source.h
   icecast/branches/kh/icecast/win32/icecast2.iss
Log:
kh11. commit fixes to reported bugs since kh10 update. possible deadlock on file
serving, relay removal (eg as a slave) cleanup and worker busy looping.


Modified: icecast/branches/kh/icecast/NEWS
===================================================================
--- icecast/branches/kh/icecast/NEWS	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/NEWS	2009-07-18 01:47:06 UTC (rev 16298)
@@ -1,5 +1,6 @@
 Feature differences from SVN trunk
 
+. define a fixed number of worker threads (default 1) for processing clients
 . allow for wildcards (*[] expansion) in mount-name and ban/allow files
 . can limit mountpoint by outgoing bandwidth as well as a max listeners count
 . can drop new listeners if server-wide bitrate is above a limit
@@ -15,6 +16,12 @@
 any extra tags are show in the conf/icecast.xml.dist file
 
 
+2.3.2-kh11
+. busy looping caused by truncation on 32bit setups
+. avoid possible deadlock between file release and open
+. relay client handles were not being cleaned up fully.
+. send Host: header on relay connects.
+
 2.3.2-kh10
 . big internal thread change. instead of one thread per stream, we now have a fixed number
   of worker threads, each processing a set of clients (sources/relays/listeners etc).

Modified: icecast/branches/kh/icecast/config.h.vc6
===================================================================
--- icecast/branches/kh/icecast/config.h.vc6	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/config.h.vc6	2009-07-18 01:47:06 UTC (rev 16298)
@@ -95,7 +95,7 @@
 #define PACKAGE_NAME "Icecast"
 
 /* Version number of package */
-#define VERSION "2.3.2-kh10"
+#define VERSION "2.3.2-kh11"
 
 /* Define to the version of this package. */
 #define PACKAGE_VERSION VERSION

Modified: icecast/branches/kh/icecast/configure.in
===================================================================
--- icecast/branches/kh/icecast/configure.in	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/configure.in	2009-07-18 01:47:06 UTC (rev 16298)
@@ -1,4 +1,4 @@
-AC_INIT([Icecast], [2.3.2-kh10], [karl at xiph.org])
+AC_INIT([Icecast], [2.3.2-kh11], [karl at xiph.org])
 
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR(src/main.c)

Modified: icecast/branches/kh/icecast/src/client.h
===================================================================
--- icecast/branches/kh/icecast/src/client.h	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/src/client.h	2009-07-18 01:47:06 UTC (rev 16298)
@@ -25,7 +25,7 @@
 #include "connection.h"
 #include "refbuf.h"
 #include "httpp/httpp.h"
-#include "compat.h"
+#include "compat.h"
 #include "thread/thread.h"
 
 struct _worker_t

Modified: icecast/branches/kh/icecast/src/fserve.c
===================================================================
--- icecast/branches/kh/icecast/src/fserve.c	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/src/fserve.c	2009-07-18 01:47:06 UTC (rev 16298)
@@ -492,9 +492,16 @@
         thread_mutex_unlock (&fh->lock);
         return;
     }
+    /* now we will probably remove the fh, but to prevent a deadlock with
+     * open_fh, we drop the node lock and acquire the tree and node locks
+     * in that order and only remove if the refcount is still 0 */
+    thread_mutex_unlock (&fh->lock);
     avl_tree_wlock (fh_cache);
-    thread_mutex_unlock (&fh->lock);
-    avl_delete (fh_cache, fh, _delete_fh);
+    thread_mutex_lock (&fh->lock);
+    if (fh->refcount)
+        thread_mutex_unlock (&fh->lock);
+    else
+        avl_delete (fh_cache, fh, _delete_fh);
     avl_tree_unlock (fh_cache);
 }
 

Modified: icecast/branches/kh/icecast/src/slave.c
===================================================================
--- icecast/branches/kh/icecast/src/slave.c	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/src/slave.c	2009-07-18 01:47:06 UTC (rev 16298)
@@ -77,6 +77,7 @@
 static void redirector_clearall (void);
 static int  relay_startup (client_t *client);
 static int  relay_read (client_t *client);
+static void relay_release (client_t *client);
 
 int slave_running = 0;
 int worker_count;
@@ -96,13 +97,13 @@
 struct _client_functions relay_client_ops =
 {
     relay_read,
-    client_destroy
+    relay_release
 };
 
 struct _client_functions relay_startup_ops =
 {
     relay_startup,
-    client_destroy
+    relay_release
 };
 
 
@@ -355,11 +356,13 @@
          */
         sock_write(streamsock, "GET %s HTTP/1.0\r\n"
                 "User-Agent: %s\r\n"
+                "Host: %s\r\n"
                 "%s"
                 "%s"
                 "\r\n",
                 mount,
                 server_id,
+                server,
                 relay->mp3metadata ? "Icy-MetaData: 1\r\n" : "",
                 auth_header);
         memset (header, 0, sizeof(header));
@@ -720,10 +723,12 @@
 
         if (release->source && release->source->client)
         {
+            release->cleanup = 1;
+            release->start = 0;
             if (release->running)
             {
-                /* relay has been removed from xml, shut down active relay */
-                DEBUG1 ("source shutdown request on \"%s\"", release->localmount);
+                /* relay has been removed from xml/streamlist, shut down active relay */
+                INFO1 ("source shutdown request on \"%s\"", release->localmount);
                 release->running = 0;
                 release->source->flags &= ~SOURCE_RUNNING;
             }
@@ -1223,7 +1228,7 @@
     thread_mutex_lock (&source->lock);
     if (source_running (source))
     {
-        if (relay->enable == 0)
+        if (relay->enable == 0 || relay->cleanup)
             source->flags &= ~SOURCE_RUNNING;
         if (relay->on_demand && source->listeners == 0)
             source->flags &= ~SOURCE_RUNNING;
@@ -1267,16 +1272,23 @@
     stats_event (relay->localmount, NULL, NULL);
     global_reduce_bitrate_sampling (global.out_bitrate);
     thread_rwlock_unlock (&global.shutdown_lock);
-    relay_free (relay);
     return -1;
 }
 
 
+static void relay_release (client_t *client)
+{
+    relay_server *relay = client->shared_data;
+    relay_free (relay);
+    client_destroy (client);
+}
+
+
 static int relay_startup (client_t *client)
 {
     relay_server *relay = client->shared_data;
 
-    if (global.running != ICE_RUNNING)
+    if (global.running != ICE_RUNNING || relay->cleanup)
         return -1;
     if (relay->enable == 0 || relay->start > client->worker->current_time.tv_sec)
     {

Modified: icecast/branches/kh/icecast/src/source.h
===================================================================
--- icecast/branches/kh/icecast/src/source.h	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/src/source.h	2009-07-18 01:47:06 UTC (rev 16298)
@@ -115,8 +115,6 @@
 #define SOURCE_BLOCK_SYNC           01
 #define SOURCE_BLOCK_RELEASE        02
 
-#define SOURCE_BLOCK_SYNC           01
-
 #endif
 
 

Modified: icecast/branches/kh/icecast/win32/icecast2.iss
===================================================================
--- icecast/branches/kh/icecast/win32/icecast2.iss	2009-07-18 01:39:45 UTC (rev 16297)
+++ icecast/branches/kh/icecast/win32/icecast2.iss	2009-07-18 01:47:06 UTC (rev 16298)
@@ -3,7 +3,7 @@
 
 [Setup]
 AppName=Icecast2-KH
-AppVerName=Icecast v2.3.2-kh10
+AppVerName=Icecast v2.3.2-kh11
 AppPublisherURL=http://www.icecast.org
 AppSupportURL=http://www.icecast.org
 AppUpdatesURL=http://www.icecast.org
@@ -13,7 +13,7 @@
 LicenseFile=..\COPYING
 InfoAfterFile=..\README
 OutputDir=.
-OutputBaseFilename=icecast2_win32_v2.3.2-kh10_setup
+OutputBaseFilename=icecast2_win32_v2.3.2-kh11_setup
 WizardImageFile=icecast2logo2.bmp
 WizardImageStretch=no
 ; uncomment the following line if you want your installation to run on NT 3.51 too.



More information about the commits mailing list