[xiph-commits] r9115 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Wed Apr 6 08:58:08 PDT 2005


Author: karl
Date: 2005-04-06 08:58:06 -0700 (Wed, 06 Apr 2005)
New Revision: 9115

Modified:
   icecast/branches/kh/icecast/src/auth.c
   icecast/branches/kh/icecast/src/fserve.c
   icecast/branches/kh/icecast/src/stats.c
Log:
global stat values were not making it to stats listeners. Add missing
slave redirect and make sure we don't double free clients in auth
fserve clients


Modified: icecast/branches/kh/icecast/src/auth.c
===================================================================
--- icecast/branches/kh/icecast/src/auth.c	2005-04-06 15:52:55 UTC (rev 9114)
+++ icecast/branches/kh/icecast/src/auth.c	2005-04-06 15:58:06 UTC (rev 9115)
@@ -291,7 +291,13 @@
         }
         ret = add_client_to_source (source, client);
         avl_tree_unlock (global.source_tree);
-        DEBUG0 ("client authenticated, passed to source");
+        if (ret == 0)
+            DEBUG0 ("client authenticated, passed to source");
+        else
+        {
+            if (slave_redirect (mount, client))
+                ret = 0;
+        }
     }
     else
     {
@@ -353,6 +359,7 @@
         auth_user->process = client->auth->authenticate;
         auth_user->client = client;
 
+        INFO0 ("adding client for authentication");
         queue_auth_client (auth_user);
     }
     else

Modified: icecast/branches/kh/icecast/src/fserve.c
===================================================================
--- icecast/branches/kh/icecast/src/fserve.c	2005-04-06 15:52:55 UTC (rev 9114)
+++ icecast/branches/kh/icecast/src/fserve.c	2005-04-06 15:58:06 UTC (rev 9115)
@@ -387,7 +387,7 @@
             WARN2 ("req for file \"%s\" %s", fullpath, strerror (errno));
             client_send_404 (httpclient, "The file you requested could not be found");
             free (fullpath);
-            return -1;
+            return 0;
         }
         m3u_file_available = 0;
     }
@@ -430,7 +430,7 @@
         client_destroy (httpclient);
         free (sourceuri);
         free (fullpath);
-        return -1;
+        return 0;
     }
 
     if (util_check_valid_extension (fullpath) == XSLT_CONTENT)
@@ -444,14 +444,14 @@
         stats_transform_xslt (httpclient, fullpath);
         client_destroy (httpclient);
         free (fullpath);
-        return -1;
+        return 0;
     }
 
     client->file = fopen (fullpath, "rb");
     if (client->file == NULL)
     {
         client_send_404 (httpclient, "File not readable");
-        return -1;
+        return 0;
     }
 
     client->client = httpclient;
@@ -471,7 +471,7 @@
                 "<b>Server is full, try again later.</b>\r\n");
         if(bytes > 0) httpclient->con->sent_bytes = bytes;
         fserve_client_destroy(client);
-        return -1;
+        return 0;
     }
     global.clients++;
     global_unlock();
@@ -550,7 +550,7 @@
             "HTTP/1.0 416 Request Range Not Satisfiable\r\n\r\n");
     if(bytes > 0) httpclient->con->sent_bytes = bytes;
     fserve_client_destroy (client);
-    return -1;
+    return 0;
 }
 
 static int _free_client(void *key)

Modified: icecast/branches/kh/icecast/src/stats.c
===================================================================
--- icecast/branches/kh/icecast/src/stats.c	2005-04-06 15:52:55 UTC (rev 9114)
+++ icecast/branches/kh/icecast/src/stats.c	2005-04-06 15:58:06 UTC (rev 9115)
@@ -419,6 +419,8 @@
         }
         str = malloc (16);
         snprintf (str, 16, "%d", value);
+        if (event->value == NULL)
+            event->value = strdup (str);
     }
     else
         str = (char *)strdup (event->value);



More information about the commits mailing list