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

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Sat May 28 07:58:32 PDT 2005


Author: karl
Date: 2005-05-28 07:58:27 -0700 (Sat, 28 May 2005)
New Revision: 9322

Modified:
   icecast/branches/kh/icecast/src/cfgfile.c
   icecast/branches/kh/icecast/src/cfgfile.h
   icecast/branches/kh/icecast/src/yp.c
Log:
remove duplication


Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2005-05-27 20:59:46 UTC (rev 9321)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2005-05-28 14:58:27 UTC (rev 9322)
@@ -607,7 +607,7 @@
         }
         else if (strcmp(node->name, "no-yp") == 0) {
             tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
-            mount->no_yp = atoi(tmp);
+            mount->yp_public = atoi(tmp)==0 ? -1 : 0;
             if(tmp) xmlFree(tmp);
         }
         else if (strcmp(node->name, "hidden") == 0) {

Modified: icecast/branches/kh/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.h	2005-05-27 20:59:46 UTC (rev 9321)
+++ icecast/branches/kh/icecast/src/cfgfile.h	2005-05-28 14:58:27 UTC (rev 9322)
@@ -61,7 +61,6 @@
     int burst_size; /* amount to send to a new client if possible, -1 take
                      * from global setting */
     unsigned int queue_size_limit;
-    int no_yp; /* Do we prevent YP on this mount */
     int hidden; /* Do we list this on the xsl pages */
     unsigned int source_timeout;  /* source timeout in seconds */
     int mp3_meta_interval; /* outgoing per-stream metadata interval */

Modified: icecast/branches/kh/icecast/src/yp.c
===================================================================
--- icecast/branches/kh/icecast/src/yp.c	2005-05-27 20:59:46 UTC (rev 9321)
+++ icecast/branches/kh/icecast/src/yp.c	2005-05-28 14:58:27 UTC (rev 9322)
@@ -764,92 +764,51 @@
     if (!info)
         return;
 
+    escaped = util_url_escape(info);
+    if (escaped == NULL)
+        return;
+
     switch (type)
     {
         case YP_SERVER_NAME:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->server_name)
-                    free (yp->server_name);
-                yp->server_name = escaped;
-            }
+            free (yp->server_name);
+            yp->server_name = escaped;
             break;
         case YP_SERVER_DESC:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->server_desc)
-                    free (yp->server_desc);
-                yp->server_desc = escaped;
-            }
+            free (yp->server_desc);
+            yp->server_desc = escaped;
             break;
         case YP_SERVER_GENRE:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->server_genre)
-                    free (yp->server_genre);
-                yp->server_genre = escaped;
-            }
+            free (yp->server_genre);
+            yp->server_genre = escaped;
             break;
         case YP_SERVER_URL:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->url)
-                    free (yp->url);
-                yp->url = escaped;
-            }
+            free (yp->url);
+            yp->url = escaped;
             break;
         case YP_BITRATE:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->bitrate)
-                    free (yp->bitrate);
-                yp->bitrate = escaped;
-            }
+            free (yp->bitrate);
+            yp->bitrate = escaped;
             break;
         case YP_AUDIO_INFO:
-            if (yp->audio_info)
-                free (yp->audio_info);
-            yp->audio_info = strdup (info);
+            free (yp->audio_info);
+            yp->audio_info = escaped;
             break;
         case YP_SERVER_TYPE:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->server_type)
-                    free (yp->server_type);
-                yp->server_type = escaped;
-            }
+            free (yp->server_type);
+            yp->server_type = escaped;
             break;
         case YP_CURRENT_SONG:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->current_song)
-                    free (yp->current_song);
-                yp->current_song = escaped;
-            }
+            free (yp->current_song);
+            yp->current_song = escaped;
             break;
         case YP_CLUSTER_PASSWORD:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                if (yp->cluster_password)
-                    free (yp->cluster_password);
-                yp->cluster_password = escaped;
-            }
+            free (yp->cluster_password);
+            yp->cluster_password = escaped;
             break;
         case YP_SUBTYPE:
-            escaped = util_url_escape(info);
-            if (escaped)
-            {
-                free (yp->subtype);
-                yp->subtype = escaped;
-            }
+            free (yp->subtype);
+            yp->subtype = escaped;
             break;
     }
 }



More information about the commits mailing list