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

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Apr 7 05:52:26 PDT 2005


Author: karl
Date: 2005-04-07 05:52:23 -0700 (Thu, 07 Apr 2005)
New Revision: 9122

Modified:
   icecast/branches/kh/icecast/src/admin.c
   icecast/branches/kh/icecast/src/source.c
Log:
fixup auth references on web interface


Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c	2005-04-07 11:18:08 UTC (rev 9121)
+++ icecast/branches/kh/icecast/src/admin.c	2005-04-07 12:52:23 UTC (rev 9122)
@@ -240,6 +240,9 @@
         thread_mutex_lock (&source->lock);
         if (source->running || source->on_demand)
         {
+            ice_config_t *config;
+            mount_proxy *mountinfo;
+
             srcnode = xmlNewChild (xmlnode, NULL, "source", NULL);
             xmlSetProp (srcnode, "mount", source->mount);
 
@@ -248,25 +251,23 @@
                     source->fallback_mount:"");
             snprintf (buf, sizeof(buf), "%u", source->listeners);
             xmlNewChild (srcnode, NULL, "listeners", buf);
+
+            config = config_get_config();
+            mountinfo = config_find_mount (config, source->mount);
+            if (mountinfo->auth)
+            {
+                xmlNewChild(srcnode, NULL, "authenticator", 
+                        mountinfo->auth->type);
+            }
+            config_release_config();
+
             if (source->running)
             {
-                ice_config_t *config;
-                mount_proxy *mountinfo;
-
                 snprintf (buf, sizeof(buf), "%lu",
                         (unsigned long)(now - source->con->con_time));
                 xmlNewChild (srcnode, NULL, "Connected", buf);
                 xmlNewChild (srcnode, NULL, "content-type", 
                         source->format->contenttype);
-
-                config = config_get_config();
-                mountinfo = config_find_mount (config, source->mount);
-                if (mountinfo->auth)
-                {
-                    xmlNewChild(srcnode, NULL, "authenticator", 
-                            mountinfo->auth->type);
-                }
-                config_release_config();
             }
         }
         thread_mutex_unlock (&source->lock);
@@ -794,12 +795,11 @@
     char *password = NULL;
     char *message = NULL;
     int ret = AUTH_OK;
-    mount_proxy *mountinfo = NULL;
+    ice_config_t *config = config_get_config ();
+    mount_proxy *mountinfo = config_find_mount (config, source->mount);
 
     if((COMMAND_OPTIONAL(client, "action", action)))
     {
-        ice_config_t *config = config_get_config ();
-        mountinfo = config_find_mount (config, source->mount);
         if (mountinfo == NULL || mountinfo->auth == NULL)
         {
             WARN1 ("manage auth request for %s but no facility available", source->mount);
@@ -831,7 +831,6 @@
                 message = strdup("User deleted");
             }
         }
-        config_release_config ();
     }
 
     doc = xmlNewDoc("1.0");
@@ -849,6 +848,8 @@
     if (mountinfo && mountinfo->auth && mountinfo->auth->listuser)
         mountinfo->auth->listuser (mountinfo->auth, srcnode);
 
+    config_release_config ();
+
     admin_send_response(doc, client, response, 
             MANAGEAUTH_TRANSFORMED_REQUEST);
     if (message) {

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2005-04-07 11:18:08 UTC (rev 9121)
+++ icecast/branches/kh/icecast/src/source.c	2005-04-07 12:52:23 UTC (rev 9122)
@@ -1125,6 +1125,8 @@
     else
         stats_event (source->mount, "on-demand", NULL);
 
+    stats_event (source->mount, "authenticator", mountinfo->auth->type);
+
     DEBUG1 ("max listeners to %d", source->max_listeners);
     DEBUG1 ("queue size to %u", source->queue_size_limit);
     DEBUG1 ("burst size to %u", source->burst_size);



More information about the commits mailing list