[xiph-commits] r11267 - in icecast/branches/kh/icecast: . admin conf doc src web

karl at svn.xiph.org karl at svn.xiph.org
Sun Apr 23 20:15:44 PDT 2006


Author: karl
Date: 2006-04-23 20:15:24 -0700 (Sun, 23 Apr 2006)
New Revision: 11267

Modified:
   icecast/branches/kh/icecast/NEWS
   icecast/branches/kh/icecast/admin/listclients.xsl
   icecast/branches/kh/icecast/admin/listmounts.xsl
   icecast/branches/kh/icecast/admin/logs.xsl
   icecast/branches/kh/icecast/admin/manageauth.xsl
   icecast/branches/kh/icecast/admin/managerelays.xsl
   icecast/branches/kh/icecast/admin/moveclients.xsl
   icecast/branches/kh/icecast/admin/response.xsl
   icecast/branches/kh/icecast/admin/showlog.xsl
   icecast/branches/kh/icecast/admin/stats.xsl
   icecast/branches/kh/icecast/admin/updatemetadata.xsl
   icecast/branches/kh/icecast/conf/icecast.xml.in
   icecast/branches/kh/icecast/conf/icecast_shoutcast_compat.xml.in
   icecast/branches/kh/icecast/configure.in
   icecast/branches/kh/icecast/doc/icecast2_config_file.html
   icecast/branches/kh/icecast/src/admin.c
   icecast/branches/kh/icecast/src/auth_url.c
   icecast/branches/kh/icecast/src/cfgfile.c
   icecast/branches/kh/icecast/src/cfgfile.h
   icecast/branches/kh/icecast/src/connection.c
   icecast/branches/kh/icecast/src/format_mp3.c
   icecast/branches/kh/icecast/src/format_mp3.h
   icecast/branches/kh/icecast/src/format_ogg.c
   icecast/branches/kh/icecast/src/format_ogg.h
   icecast/branches/kh/icecast/src/format_vorbis.c
   icecast/branches/kh/icecast/src/logging.c
   icecast/branches/kh/icecast/src/slave.c
   icecast/branches/kh/icecast/src/source.c
   icecast/branches/kh/icecast/src/source.h
   icecast/branches/kh/icecast/src/stats.c
   icecast/branches/kh/icecast/src/stats.h
   icecast/branches/kh/icecast/src/xslt.c
   icecast/branches/kh/icecast/web/auth.xsl
   icecast/branches/kh/icecast/web/navbar.html
   icecast/branches/kh/icecast/web/server_uptime.xsl
   icecast/branches/kh/icecast/web/server_version.xsl
   icecast/branches/kh/icecast/web/status.xsl
   icecast/branches/kh/icecast/web/style.css
   icecast/branches/kh/icecast/web/uptime_xml.xsl
Log:
sync up work


Modified: icecast/branches/kh/icecast/NEWS
===================================================================
--- icecast/branches/kh/icecast/NEWS	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/NEWS	2006-04-24 03:15:24 UTC (rev 11267)
@@ -5,8 +5,38 @@
   clients to alternative slave hosts. 
 . authenticated relays, those that match the relay user/pass, bypass the 
   max-listener check
+. mount can filter out theora content, useful for define a local relay of a
+  theora+vorbis stream to have a vorbis only stream from the same source.
+. multiple shoutcast source clients possible.
+. a per-mount charset can be defined, translates to UTF8.
+. stream-auth option for url authenticator.
 
 
+2.3-kh5
+. add media-type to xsl pages, IE has trouble with xhtml
+. add <accesslog-exclude-ext> for defining extensions that do not get reported
+  via the web interface (they are still written in the log file). Whether
+  alternative tags should be used is still undertermined.
+. fix for empty log display via xsl, produced odd chars.
+. auth url avoids calling backend code when settings are not defined.
+. content type fixes for xslt files
+. allow <shoutcast-mount> to appear in <listen-socket>, this defines a per-port
+  based mountpoint allowing multiple shoutcast source clients to connect. This
+  also defines a port+1 listen-socket automatically.
+. xml parsing changed, 'yes' and 'true' can be taken for boolean settings. some
+  removal of deprecated tags but may of missed a tag so report if any are.
+. added <filter-theora> boolean for <mount>, filters theora out of passed stream
+  so listener only gets what is left.
+. add per-mount listener_connections stat
+. add <allow-url-ogg-metadata> bool per-mount, enable to allow url based metadata
+  updates. Default disabled.
+. add charset option to mount options. It allows for conversion to UTF8
+  for the stats/web pages and therefore YP listings and playlist log.
+. minor changes to web pages.
+. allow for 403 response from auth url to pass back to listener, in the case of
+  a 200 response from auth server, allow 403 at start of message to indicate a
+  403 response to listener.
+
 2.3-kh4
 . fserve thread now looks for a chain of refbufs as well.
 . plug leaks from coverity code analysis. mainly minor but a possible fd leak.

Modified: icecast/branches/kh/icecast/admin/listclients.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/listclients.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/listclients.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
@@ -22,7 +25,7 @@
 
 <xsl:choose>
 <xsl:when test="authenticator">
-<a href="auth.xsl"><img border="0" src="/images/key.png"/></a> Authentication Required
+<a href="/auth.xsl"><img border="0" src="/images/key.png"/></a> Authentication Required
 </xsl:when>
 <xsl:otherwise>
 <a href="{@mount}.m3u"><img border="0" src="/images/tunein.png"/></a> Mount Point
@@ -53,7 +56,7 @@
 <xsl:variable name = "themount" ><xsl:value-of select="@mount" /></xsl:variable>
 <xsl:for-each select="listener">
 		<tr>
-				<td align="center"><xsl:value-of select="IP" /><xsl:if test="username"> (<xsl:value-of select="username" />)</xsl:if></td>
+				<td align="center"><xsl:value-of select="IP" /><xsl:if test="Username"> (<xsl:value-of select="Username" />)</xsl:if></td>
 				<td align="center"><xsl:value-of select="Connected" /> seconds</td>
 				<td align="center"><xsl:value-of select="UserAgent" /></td>
 				<td align="center"><a href="killclient.xsl?mount={$themount}&amp;id={ID}">Kick</a></td>

Modified: icecast/branches/kh/icecast/admin/listmounts.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/listmounts.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/listmounts.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,16 +1,19 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
 <title>Icecast Streaming Media Server</title>
 <link rel="stylesheet" type="text/css" href="/style.css" />
 </head>
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Active Mountpoints</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/adminbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/adminbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">
@@ -21,7 +24,7 @@
 <h3>
 <xsl:choose>
 <xsl:when test="authenticator">
-<a href="auth.xsl"><img border="0" src="/images/key.png"/></a> Authentication Required
+<a href="/auth.xsl"><img border="0" src="/images/key.png"/></a> Authentication Required
 </xsl:when>
 <xsl:otherwise>
 <a href="{@mount}.m3u"><img border="0" src="/images/tunein.png"/></a> Mount Point

Modified: icecast/branches/kh/icecast/admin/logs.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/logs.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/logs.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,16 +1,18 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
 <xsl:template match = "/icestats" >
 <html>
 <head>
 <title>Icecast Streaming Media Server</title>
 <link rel="stylesheet" type="text/css" href="/style.css" />
 </head>
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Icecast2 logs</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/adminbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/adminbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">
@@ -18,7 +20,7 @@
 </div>
 <div class="newscontent">
 <h3>Access log</h3>
-<iframe width="100%" height="400" src="showlog.xsl?log=accesslog">
+<iframe frameborder="0" width="100%" height="400" src="showlog.xsl?log=accesslog">
 no frame support however contents can be found <a href="showlog.xsl?log=accesslog">here</a>
 </iframe>
 </div>
@@ -35,7 +37,7 @@
 </div>
 <div class="newscontent">
 <h3>Error log</h3>
-<iframe width="100%" height="400" padding="5"  src="showlog.xsl?log=errorlog">
+<iframe frameborder="0" width="100%" height="400" padding="5"  src="showlog.xsl?log=errorlog">
 no frame support however contents can be found <a href="showlog.xsl?log=errorlog">here</a>
 </iframe>
 </div>
@@ -52,7 +54,7 @@
 </div>
 <div class="newscontent">
 <h3>Playlist log</h3>
-<iframe width="100%" height="300" src="showlog.xsl?log=playlistlog">
+<iframe frameborder="0" width="100%" height="300" src="showlog.xsl?log=playlistlog">
 no frame support however contents can be found <a href="showlog.xsl?log=playlistlog">here</a>
 </iframe>
 </div>

Modified: icecast/branches/kh/icecast/admin/manageauth.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/manageauth.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/manageauth.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>

Modified: icecast/branches/kh/icecast/admin/managerelays.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/managerelays.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/managerelays.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,16 +1,19 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icerelaystats" >
 <html>
 <head>
 <title>Icecast Streaming Media Server</title>
 <link rel="stylesheet" type="text/css" href="/style.css" />
 </head>
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Relay Management</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/adminbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/adminbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">

Modified: icecast/branches/kh/icecast/admin/moveclients.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/moveclients.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/moveclients.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>

Modified: icecast/branches/kh/icecast/admin/response.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/response.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/response.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,16 +1,19 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/iceresponse" >
 <html>
 <head>
 <title>Icecast Streaming Media Server</title>
 <link rel="stylesheet" type="text/css" href="/style.css" />
 </head>
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Icecast Server Response</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/adminbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/adminbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">

Modified: icecast/branches/kh/icecast/admin/showlog.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/showlog.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/showlog.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,19 +1,19 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
 <xsl:template match = "/icestats" >
 <html>
 <head>
-<link rel="stylesheet" type="text/css" href="/style.css" />
+<title>Icecast log files</title>
 </head>
-<div class="logs">
-<body>
+<body style="color: white; font-size: 90%">
 <table>
-<tr><td><pre>
+<tr><td><pre> 
 <xsl:for-each select="/icestats"> <xsl:for-each select="log"> <xsl:value-of select="." /> </xsl:for-each></xsl:for-each>
 </pre></td></tr>
 </table>
 </body>
-</div>
 </html>
 
 </xsl:template>

Modified: icecast/branches/kh/icecast/admin/stats.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/stats.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/stats.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
@@ -10,7 +13,7 @@
 
 <div class="main">
 <h1>Icecast2 Admin</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/adminbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/adminbar.html" />
 
 <br />
 

Modified: icecast/branches/kh/icecast/admin/updatemetadata.xsl
===================================================================
--- icecast/branches/kh/icecast/admin/updatemetadata.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/admin/updatemetadata.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>

Modified: icecast/branches/kh/icecast/conf/icecast.xml.in
===================================================================
--- icecast/branches/kh/icecast/conf/icecast.xml.in	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/conf/icecast.xml.in	2006-04-24 03:15:24 UTC (rev 11267)
@@ -55,7 +55,11 @@
     <!--<master-server>127.0.0.1</master-server>-->
     <!--<master-server-port>8001</master-server-port>-->
     <!--<master-update-interval>120</master-update-interval>-->
+
+    <!--<master-username>hackme</master-username>-->
     <!--<master-password>hackme</master-password>-->
+
+    <!-- issue above authentication for relays in slave setup -->
     <!--<master-relay-auth>1</master-relay-auth>-->
 
     <!-- setting this makes all relays on-demand unless overridden, this is
@@ -68,6 +72,10 @@
          the details passed are based on <hostname> and <port> -->
     <!--<master-redirect>1</master-redirect>-->
 
+    <!-- The maximum nuber of slaves that can register for new listener 
+    redirection. -->
+    <!--<max-redirect-slaves>10</max-redirect-slaves>-->
+
     <!-- Relays. State connection information, and by default 
          request inline metadata for mp3 streams if available.
          An on-demand relay will only retrieve the stream if

Modified: icecast/branches/kh/icecast/conf/icecast_shoutcast_compat.xml.in
===================================================================
--- icecast/branches/kh/icecast/conf/icecast_shoutcast_compat.xml.in	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/conf/icecast_shoutcast_compat.xml.in	2006-04-24 03:15:24 UTC (rev 11267)
@@ -23,19 +23,17 @@
     It affects mainly the urls generated by Icecast for playlists and yp
     listings. -->
     <hostname>localhost</hostname>
-    <!-- You MUST define 2 ports, port and port +1 -->
+
+    <!-- each shoutcast source clients require 2 ports, port and port+1 -->
     <listen-socket>
-        <!-- Configure the shoutcast DSP with *this* port 
-             the shoutcast DSP actually will connect the
-             encoder to this port + 1 -->
+        <!-- define the base port that the shoutcast DSP will use -->
         <port>8000</port>
+        <!-- the following is acts as a switch to not only inform icecast 
+        of the mountpoint to use but also that port+1 should be implicitily
+        defined as well. -->
+        <shoutcast-mount>/live</shoutcast-mount>
     </listen-socket>
-    <listen-socket>
-        <!-- This port *must* be one larger than the one defined
-             above and defined as 'shoutcast-compat' -->
-        <port>8001</port>
-        <shoutcast-compat>1</shoutcast-compat>
-    </listen-socket>
+
     <fileserve>1</fileserve>
     <paths>
         <logdir>@localstatedir@/log/@PACKAGE@</logdir>

Modified: icecast/branches/kh/icecast/configure.in
===================================================================
--- icecast/branches/kh/icecast/configure.in	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/configure.in	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,4 +1,4 @@
-AC_INIT([Icecast], [2.3-kh4], [karl at xiph.org])
+AC_INIT([Icecast], [2.3-kh5], [karl at xiph.org])
 
 AC_PREREQ(2.54)
 AC_CONFIG_SRCDIR(src/main.c)
@@ -65,7 +65,7 @@
 dnl Check for types
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS(localtime_r poll)
+AC_CHECK_FUNCS(localtime_r poll atoll strtoll)
 AC_SEARCH_LIBS(nanosleep, rt posix4,
         AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
 XIPH_NET

Modified: icecast/branches/kh/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/branches/kh/icecast/doc/icecast2_config_file.html	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/doc/icecast2_config_file.html	2006-04-24 03:15:24 UTC (rev 11267)
@@ -54,10 +54,6 @@
 <div class="indentedbox">
 Maximum number of connected sources supported by the server.
 </div>
-<h4>threadpool</h4>
-<div class="indentedbox">
-This is the number of threads that are started to handle client connections.  You may need to increase this value if you are running a high traffic stream.  This recommended value is for a small to medium traffic server.
-</div>
 <h4>queue-size</h4>
 <div class="indentedbox">
 This is the maximum size (in bytes) of a client (listener) queue.  A listener may temporarily lag behind due to network congestion and in this case an internal queue is maintained for each listener.  If the queue grows larger than this config value, then the listener will be removed from the stream.
@@ -76,14 +72,16 @@
 </div>
 <h4>burst-on-connect</h4>
 <div class="indentedbox">
-With this enabled, a connecting client will be sent a burst of audio data from the stream.  This will have the effect of reducing the startup time for the stream from the perspective of the listener.  This is due to the fact that most media players have local buffers that must be filled before the stream begins to play.  This may introduce a small latency in the stream (difference in time between when the source plays a clip and the listener hears a clip).  If this latency is important to you, then you can disable this feature.  The latency is bitrate-dependent, but as an example, for a 128kbps stream, the latency between the source and the player is ~ 1.5 secs WITHOUT burst on connect, and WITH burst on connect the latency is 3 secs.
+This is an alias for burst-size, enabled it's 64k, disabled it's 0. 
 </div>
 <h4>burst-size</h4>
 <div class="indentedbox">
-The burst size is the amount of data (in bytes) to burst to a client at connection time. Like
-burst-on-connect, this is to quickly fill the pre-buffer used by media players. The default
-is 64kbytes which is a typical size used by most clients so changing it is not usually required.
-This setting applies to all mountpoints.
+The burst size is the amount of data (in bytes) to burst to a client at connection time.  This
+is to quickly fill the pre-buffer used by media players. It does this by sending stream data
+that has already been sent so adds latency between the source and player, this isn not a problem
+for most people as the listeners only hear the player component.  The default is 64kbytes which
+is a typical size used by most clients so changing it is not usually required.  This setting
+applies to all mountpoints, unless overridden in the mount settings.
 </div>
 <p>
 <br />
@@ -163,11 +161,12 @@
     &lt;listen-socket&gt;
         &lt;port&gt;8000&lt;/port&gt;
         &lt;bind-address&gt;127.0.0.1&lt;/bind-address&gt;
+        &lt;shoutcast-mount&gt;/mystream&lt;/shoutcast-mount&gt;
     &lt;/listen-socket&gt;
     &lt;listen-socket&gt;
-        &lt;port&gt;8001&lt;/port&gt;
+        &lt;port&gt;8002&lt;/port&gt;
         &lt;bind-address&gt;127.0.0.1&lt;/bind-address&gt;
-        &lt;shoutcast-compat&gt;1&lt;/shoutcast-compat&gt;
+        &lt;shoutcast-mount&gt;/live&lt;/shoutcast-mount&gt;
     &lt;/listen-socket&gt;
 
     &lt;fileserve&gt;1&lt;/fileserve&gt;
@@ -178,7 +177,12 @@
 If a bind-address is not specified for a particular listen-socket, then the socket will be
 bound to all interfaces. Generally, you won't need to set bind-address. There is an internal
 limit of 20 listening sockets currently, which may be extended in later releases.
+<p>One example where multiple ports are used is when shoutcast source clients are used to 
+stream data to icecast.  Shoutcast source clients use a limited protocol, they require two
+sequential ports. The base port acts like a normal web servre type port used for metadata
+updates but the second has an unusual protocol which has stream data sent to it.
 </p>
+<p>The following list the options for use with a listen-socket
 <h4>port</h4>
 <div class="indentedbox">
 The TCP port that will be used to accept client connections.
@@ -187,16 +191,28 @@
 <div class="indentedbox">
 An optional IP address that can be used to bind to a specific network card.  If not supplied, then it will bind to all interfaces.
 </div>
+<h4>shoutcast-mount</h4>
+<div class="indentedbox">
+This option allows for setting the mountpoint for a shoutcast source client to be used by this
+socket and the port number following it, which is automatically allocated for you. Defining
+this within the ports allows for multiple clients to connect at the same time.
+</div>
 <h4>shoutcast-compat</h4>
 <div class="indentedbox">
+This option is deprecated now, use the shoutcast-mount setting mentioned above. This is kept
+for backward compatability.
+<p>
 This optional flag will indicate that this port will operate in 'shoutcast-compatibility' mode.  Due to major differences in the source client connection protocol, if you wish to use any of the shoutcast DJ tools, you will need to configure at least one socket as shoutcast-compatible.  Note that when in this mode, only source clients (and specifically shoutcast source clients) will be able to attach to this port.  All listeners may connect to any of the ports defined without this flag.  Also, for proper Shoutcast DSP compatibility, you must define a listen socket with a port one less than the one defined as 'shoutcast-compat'.  This means if you define 8001 as shoutcast-compat, then you will need to define a listen port of 8000 and it must not also be defined as shoutcast-compat.  See the example config file is the distribution for more info.
 </div>
+<p>The following are general server settings
 <h4>fileserve</h4>
 <div class="indentedbox">
 This flag turns on the icecast2 fileserver from which static files can be served.  All files are served relative to the path specified in the &lt;paths&gt;&lt;webroot&gt; configuration setting.
 </div>
 <h4>shoutcast-mount</h4>
 <div class="indentedbox">
+This is provided for any shoutcast source clients connecting where no mountpoint is specified
+in the listen-socket section.
 An optional mountpoint to use when shoutcast DSP compatible clients connect. The default is /stream but can
 be overridden here to use an alternative name which may include an extension that some clients require for
 certain formats.
@@ -275,12 +291,22 @@
 This is the relay password on the Master server.  It is used to query the
 server for a list of mountpoints to relay.
 </div>
+<h4>master-redirect</h4>
+<div class="indentedbox">
+When running as a slave, enable this to autenticate with the master for redirecting new
+listeners to this slave.
+</div>
 <h4>master-redirect-port</h4>
 <div class="indentedbox">
-When a slave starts a master relay using authentication, then a host and port can also be sent to
-inform the master for the purposes of redirecting clients to the slave. The host is provided by
-the hostname setting and this specifies the port to redirect listeners to.
+When a slave starts a master relay using authentication, then a host and port can also be sent
+to inform the master for the purposes of redirecting clients to the slave. The host is provided
+by the hostname setting and this specifies the port to redirect listeners to.
 </div>
+<h4>max-redirect-slaves</h4>
+<div class="indentedbox">
+When running as a master server, this will limit the maximum number of authenicating slaves
+that we will redirect new listeners to. Default is 0.
+</div>
 <h4>relays-on-demand</h4>
 <div class="indentedbox">
     <p>Changes the default on-demand setting for relays, so a stream is only relayed if
@@ -397,7 +423,9 @@
         &lt;subtype&gt;vorbis&lt;/subtype&gt;
         &lt;hidden&gt;1&lt;/hidden&gt;
         &lt;burst-size&gt;65536&lt;/burst-size&gt;
+        &lt;charset&gt;8192&lt;/charset&gt;
         &lt;mp3-metadata-interval&gt;8192&lt;/mp3-metadata-interval&gt;
+        &lt;allow_url_ogg_metadata&gt;1&lt;/allow_url_ogg_metadata&gt;
         &lt;authentication type="htpasswd"&gt;
                 &lt;option name="filename" value="myauth"/&gt;
                 &lt;option name="allow_duplicate_users" value="0"/&gt;
@@ -551,6 +579,13 @@
 This optional setting allows for providing a burst size which overrides the default burst size
 as defined in limits.  The value is in bytes.
 </div>
+<h4>charset</h4>
+<div class="indentedbox">
+    <p>Various source clients send metadata in charsets other than UTF8, and fail to say which
+    charset they are using. Here you can define an alternative charset that will convert the
+    metadata to UTF8 for stats/web and YP updates.
+    </p>
+</div>
 <h4>mp3-metadata-interval</h4>
 <div class="indentedbox">
     <p>This optional setting specifies what interval, in bytes, there is between metadata
@@ -559,6 +594,18 @@
     is either the hardcoded server default or the value passed from a relay.
     </p>
 </div>
+<h4>allow-url-ogg-metadata</h4>
+<div class="indentedbox">
+    In some cases, metadata is updated from external sources. With Ogg the metadata should be
+    sent via the source client in-stream, but enabling this allows an alternative update
+    mechanism.
+</div>
+<h4>filter-theora</h4>
+<div class="indentedbox">
+    Enabing this will remove a theora logical stream from the ogg stream coming in. This is
+    intended for cases where a source client sends a theora+vorbis stream and a local relay
+    can relay that and filter out the theora part leaving a mountpoint with only vorbis.
+</div>
 <h4>hidden</h4>
 <div class="indentedbox">
 Enable this to prevent this mount from being shown on the xsl pages.  This is mainly

Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/admin.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -420,7 +420,7 @@
     if (mount)
     {
         /* certain commands may not need auth */
-        if (strcmp (uri, BUILDM3U_RAW_REQUEST) == 0)
+        if (admin_get_command (uri) == COMMAND_BUILDM3U)
             client->authenticated = 1;
 
         /* This is a mount request, but admin user is allowed */
@@ -1184,17 +1184,16 @@
         log = accesslog;
     else if (strcmp (logname, "playlistlog") == 0)
         log = playlistlog;
-    else
+
+    if (log < 0)
     {
         WARN1 ("request to show unknown log \"%s\"", logname);
-        client_send_400 (client, "No such log");
+        client_send_400 (client, "");
         return;
     }
-    if (log >= 0)
-    {
-        content = refbuf_new (0);
-        log_contents (log, &content->data, &content->len);
-    }
+    content = refbuf_new (0);
+    log_contents (log, &content->data, &content->len);
+
     if (response == TRANSFORMED)
     {
         xmlNodePtr xmlnode, lognode;
@@ -1212,7 +1211,7 @@
     {
         refbuf_t *http = refbuf_new (100);
         int len = snprintf (http->data, 100, "%s",
-                "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
+                "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n");
         http->len = len;
         http->next = content; 
         client->respcode = 200;

Modified: icecast/branches/kh/icecast/src/auth_url.c
===================================================================
--- icecast/branches/kh/icecast/src/auth_url.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/auth_url.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -486,19 +486,11 @@
 {
     auth_url *url_info;
 
-    authenticator->authenticate = url_add_client;
-    authenticator->release_client = url_remove_client;
-
     authenticator->free = auth_url_clear;
     authenticator->adduser = auth_url_adduser;
     authenticator->deleteuser = auth_url_deleteuser;
     authenticator->listuser = auth_url_listuser;
 
-    authenticator->stream_start = url_stream_start;
-    authenticator->stream_end = url_stream_end;
-
-    authenticator->stream_auth = url_stream_auth;
-
     url_info = calloc(1, sizeof(auth_url));
     url_info->auth_header = strdup ("icecast-auth-user: 1\r\n");
     url_info->timelimit_header = strdup ("icecast-auth-timelimit:");
@@ -509,15 +501,30 @@
         if(!strcmp(options->name, "password"))
             url_info->password = strdup (options->value);
         if(!strcmp(options->name, "listener_add"))
+        {
+            authenticator->authenticate = url_add_client;
             url_info->addurl = strdup (options->value);
+        }
         if(!strcmp(options->name, "listener_remove"))
+        {
+            authenticator->release_client = url_remove_client;
             url_info->removeurl = strdup (options->value);
+        }
         if(!strcmp(options->name, "mount_add"))
+        {
+            authenticator->stream_start = url_stream_start;
             url_info->stream_start = strdup (options->value);
+        }
         if(!strcmp(options->name, "mount_remove"))
+        {
+            authenticator->stream_end = url_stream_end;
             url_info->stream_end = strdup (options->value);
+        }
         if(!strcmp(options->name, "stream_auth"))
+        {
+            authenticator->stream_auth = url_stream_auth;
             url_info->stream_auth = strdup (options->value);
+        }
         if(!strcmp(options->name, "auth_header"))
         {
             free (url_info->auth_header);

Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -515,6 +515,7 @@
 
     if (parse_xml_tags (node, icecast_tags))
         return -1;
+    config->chuid = 1;
     return 0;
 }
 
@@ -539,11 +540,13 @@
     struct cfg_tag icecast_tags[] =
     {
         { "accesslog",      config_get_str,     &config->access_log },
+        { "accesslog_exclude_ext",
+                            config_get_str,     &config->access_log_exclude_ext },
         { "accesslog_lines",
                             config_get_int,     &config->access_log_lines },
         { "errorlog",       config_get_str,     &config->error_log },
         { "errorlog_lines", config_get_int,     &config->error_log_lines },
-        { "playlistlog",    config_get_str,     &config->access_log },
+        { "playlistlog",    config_get_str,     &config->playlist_log },
         { "playlistlog_lines",
                             config_get_int,     &config->playlist_log_lines },
         { "logsize",        config_get_int,     &config->logsize },
@@ -552,6 +555,10 @@
         { NULL, NULL, NULL }
     };
 
+    config->access_log_lines = 100;
+    config->error_log_lines = 100;
+    config->playlist_log_lines = 10;
+
     if (parse_xml_tags (node, icecast_tags))
         return -1;
     return 0;
@@ -625,10 +632,11 @@
                             config_get_bool,    &mount->fallback_when_full },
         { "max-listeners",  config_get_int,     &mount->max_listeners },
         { "filter-theora",  config_get_bool,    &mount->filter_theora },
-        { "mp3-metadata-charset",
-                            config_get_str,     &mount->mp3_charset },
+        { "charset",        config_get_str,     &mount->charset },
         { "mp3-metadata-interval",
                             config_get_int,     &mount->mp3_meta_interval },
+        { "allow-url-ogg-metadata",
+                            config_get_bool,    &mount->url_ogg_meta },
         { "no-mount",       config_get_bool,    &mount->no_mount },
         { "hidden",         config_get_bool,    &mount->hidden },
         { "authentication", auth_get_authenticator,
@@ -657,6 +665,7 @@
     mount->burst_size = -1;
     mount->mp3_meta_interval = -1;
     mount->yp_public = -1;
+    mount->url_ogg_meta = 0;
 
     if (parse_xml_tags (node, icecast_tags))
         return -1;

Modified: icecast/branches/kh/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.h	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/cfgfile.h	2006-04-24 03:15:24 UTC (rev 11267)
@@ -66,9 +66,10 @@
     unsigned int queue_size_limit;
     int hidden; /* Do we list this on the xsl pages */
     unsigned int source_timeout;  /* source timeout in seconds */
-    char *mp3_charset;  /* character set for metadata */
+    char *charset;  /* character set if not utf8 */
     int mp3_meta_interval; /* outgoing per-stream metadata interval */
     int filter_theora; /* prevent theora pages getting queued */
+    int url_ogg_meta; /* enable to allow updates via url requests for ogg */
 
     char *auth_type; /* Authentication type */
     struct auth_tag *auth;
@@ -166,6 +167,7 @@
 
     char *access_log;
     int access_log_lines;
+    char *access_log_exclude_ext;
     char *error_log;
     int error_log_lines;
     char *playlist_log;

Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/connection.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -982,6 +982,33 @@
     fserve_add_client_callback (client, stats_callback, NULL);
 }
 
+static void check_for_filtering (ice_config_t *config, client_t *client)
+{
+    char *pattern = config->access_log_exclude_ext;
+    char *uri = httpp_getvar (client->parser, HTTPP_VAR_URI);
+    char *extension = strrchr (uri, '.');
+    if (extension == NULL || uri == NULL || pattern == NULL)
+        return;
+
+    extension++;
+    while (*pattern)
+    {
+        int len = strcspn (pattern, " ");
+        DEBUG3 ("...pattern is \"%.*s\" (%d)", len, pattern, len);
+        if (strncmp (extension, pattern, len) == 0 && extension[len] == '\0')
+        {
+            DEBUG0 ("found a match");
+            httpp_setvar (client->parser, "__avoid_access_log", "");
+            return;
+        }
+        pattern += len;
+        len = strspn (pattern, " "); /* find next pattern */
+        pattern += len;
+    }
+    DEBUG0 ("no match for pattern");
+}
+
+
 static void _handle_get_request (client_t *client, char *passed_uri)
 {
     int fileserve;
@@ -995,6 +1022,7 @@
 
     DEBUG1("start with %s", passed_uri);
     config = config_get_config();
+    check_for_filtering (config, client);
     fileserve = config->fileserve;
     port = config->port;
     for(i = 0; i < global.server_sockets; i++) {

Modified: icecast/branches/kh/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/format_mp3.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -182,35 +182,10 @@
             p = calloc (1, len+1);
             if (p)
             {
-                mp3_state *source_mp3 = source->format->_state;
-
                 memcpy (p, metadata+13, len);
 
-                if (source_mp3->charset)
-                {
-                    xmlBufferPtr raw = xmlBufferCreate ();
-                    xmlBufferPtr buf = xmlBufferCreate ();
+                stats_event_conv (source->mount, "title", p, source->charset);
 
-                    xmlCharEncodingHandlerPtr handle =
-                        xmlFindCharEncodingHandler (source_mp3->charset);
-                    xmlBufferAdd (raw, (const xmlChar *) p, len);
-                    if (xmlCharEncInFunc (handle, buf, raw) > 0)
-                    {
-                        stats_event (source->mount, "title", xmlBufferContent (buf));
-                        logging_playlist (source->mount,
-                                xmlBufferContent (buf), source->listeners);
-                    }
-                    else
-                        logging_playlist (source->mount, p, source->listeners);
-                    xmlFree (raw);
-                    xmlFree (buf);
-                }
-                else
-                {
-                    stats_event (source->mount, "title", p);
-                    logging_playlist (source->mount, p, source->listeners);
-                }
-
                 yp_touch (source->mount);
                 free (p);
             }
@@ -237,17 +212,6 @@
     else
         source_mp3->interval = mount->mp3_meta_interval;
     DEBUG1 ("mp3 interval %d", source_mp3->interval);
-
-    if (source_mp3->charset)
-    {
-        xmlFree (source_mp3->charset);
-        source_mp3->charset = NULL;
-    }
-    if (mount)
-    {
-        source_mp3->charset = xmlStrdup (mount->mp3_charset);
-        DEBUG1 ("mp3 charset %s", source_mp3->charset);
-    }
 }
 
 

Modified: icecast/branches/kh/icecast/src/format_mp3.h
===================================================================
--- icecast/branches/kh/icecast/src/format_mp3.h	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/format_mp3.h	2006-04-24 03:15:24 UTC (rev 11267)
@@ -25,7 +25,6 @@
     int interval;
     char *url_artist;
     char *url_title;
-    char *charset;
     int update_metadata;
 
     refbuf_t *metadata;

Modified: icecast/branches/kh/icecast/src/format_ogg.c
===================================================================
--- icecast/branches/kh/icecast/src/format_ogg.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/format_ogg.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -215,11 +215,14 @@
 {
     ogg_state_t *ogg_info = format->_state;
 
-    if (mount == NULL)
+    if (mount == NULL && format == NULL)
         return;
     if (mount->filter_theora)
         ogg_info->filter_theora = 1;
     DEBUG1 ("filter for theora is %d", ogg_info->filter_theora);
+
+    ogg_info->use_url_metadata = mount->url_ogg_meta;
+    DEBUG1 ("metadata via url is %d", ogg_info->use_url_metadata);
 }
 
 
@@ -266,6 +269,7 @@
 
         /* any others */
         ERROR0 ("Seen BOS page with unknown type");
+        ogg_info->error = 1;
         return -1;
     } while (0);
 

Modified: icecast/branches/kh/icecast/src/format_ogg.h
===================================================================
--- icecast/branches/kh/icecast/src/format_ogg.h	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/format_ogg.h	2006-04-24 03:15:24 UTC (rev 11267)
@@ -33,6 +33,7 @@
     char *artist;
     char *title;
     int log_metadata;
+    int use_url_metadata;
     refbuf_t *file_headers;
     refbuf_t *header_pages;
     refbuf_t *header_pages_tail;

Modified: icecast/branches/kh/icecast/src/format_vorbis.c
===================================================================
--- icecast/branches/kh/icecast/src/format_vorbis.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/format_vorbis.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -421,6 +421,10 @@
     vorbis_codec_t *source_vorbis;
     int change = 0;
 
+    /* avoid url updates unless allowed to */
+    if (ogg_info->use_url_metadata == 0)
+        return;
+
     /* avoid updating if multiple codecs in use */
     if (codec && codec->next == NULL)
         source_vorbis = codec->specific;

Modified: icecast/branches/kh/icecast/src/logging.c
===================================================================
--- icecast/branches/kh/icecast/src/logging.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/logging.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -115,7 +115,8 @@
     struct tm thetime;
     time_t now;
     time_t stayed;
-    char *referrer, *user_agent, *username;
+    char *referrer, *user_agent, *username, *ip = "-";
+    int keep = 0;
 
     now = global.time;
 
@@ -150,18 +151,16 @@
         user_agent = "-";
 
 #ifdef HAVE_LOGGING_IP
-    log_write_direct (accesslog,
+    ip = client->con->ip;
+#endif
+    if (httpp_getvar (client->parser, "__avoid_access_log") == NULL)
+        keep = 1;
+
+    log_write_direct_keep (accesslog, keep,
             "%s - %s [%s] \"%s\" %d " FORMAT_UINT64 " \"%s\" \"%s\" %lu",
-            client->con->ip,
-            username,
+            ip, username,
             datebuf, reqbuf, client->respcode, client->con->sent_bytes,
             referrer, user_agent, (unsigned long)stayed);
-#else
-    log_write_direct (accesslog,
-            "- - - [%s] \"%s\" %d " FORMAT_UINT64 " \"%s\" \"%s\" %lu",
-            datebuf, reqbuf, client->respcode, client->con->sent_bytes,
-            referrer, user_agent, (unsigned long)stayed);
-#endif
 }
 
 

Modified: icecast/branches/kh/icecast/src/slave.c
===================================================================
--- icecast/branches/kh/icecast/src/slave.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/slave.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -708,6 +708,7 @@
     char error [CURL_ERROR_SIZE];
     char url [1024], auth [100];
 
+    DEBUG0 ("checking master stream list");
     if (master->ssl_port)
     {
         protocol = "https";
@@ -845,7 +846,6 @@
         /* only update relays lists when required */
         if (max_interval <= interval)
         {
-            DEBUG0 ("checking master stream list");
             config = config_get_config();
 
             if (max_interval == 0)

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/source.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -999,7 +999,10 @@
             str = "Unspecified name";
         } while (0);
     }
-    stats_event (source->mount, "server_name", str);
+    if (mountinfo && mountinfo->charset)
+        stats_event_conv (source->mount, "server_name", str, mountinfo->charset);
+    else
+        stats_event (source->mount, "server_name", str);
 
     /* stream description */
     if (mountinfo && mountinfo->stream_description)
@@ -1016,7 +1019,10 @@
             str = "Unspecified description";
         } while (0);
     }
-    stats_event (source->mount, "server_description", str);
+    if (mountinfo && mountinfo->charset)
+        stats_event_conv (source->mount, "server_description", str, mountinfo->charset);
+    else
+        stats_event (source->mount, "server_description", str);
 
     /* stream URL */
     if (mountinfo && mountinfo->stream_url)
@@ -1086,6 +1092,11 @@
     if (mountinfo && mountinfo->fallback_mount)
         source->fallback_mount = strdup (mountinfo->fallback_mount);
 
+    free (source->charset);
+    source->charset = NULL;
+    if (mountinfo && mountinfo->charset)
+        source->charset = strdup (mountinfo->charset);
+
     /* needs a better mechanism, probably via a client_t handle */
     if (mountinfo && mountinfo->dumpfile)
     {
@@ -1172,6 +1183,9 @@
     else
         stats_event (source->mount, "on_demand", NULL);
 
+    if (source->charset)
+        DEBUG1 ("charset is %s", source->charset);
+
     if (source->hidden)
     {
         stats_event_hidden (source->mount, NULL, 1);

Modified: icecast/branches/kh/icecast/src/source.h
===================================================================
--- icecast/branches/kh/icecast/src/source.h	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/source.h	2006-04-24 03:15:24 UTC (rev 11267)
@@ -49,6 +49,8 @@
     char *dumpfilename; /* Name of a file to dump incoming stream to */
     FILE *dumpfile;
 
+    char *charset;
+
     unsigned long peak_listeners;
     unsigned long listeners;
     unsigned long prev_listeners;

Modified: icecast/branches/kh/icecast/src/stats.c
===================================================================
--- icecast/branches/kh/icecast/src/stats.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/stats.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -46,6 +46,9 @@
 #define snprintf _snprintf
 #define atoll _atoi64
 #endif
+#if !defined HAVE_ATOLL && defined HAVE_STRTOLL
+#define atoll(nptr) strtoll(nptr, (char **)NULL, 10)
+#endif
 
 #define STATS_EVENT_SET     0
 #define STATS_EVENT_INC     1
@@ -208,6 +211,39 @@
         queue_global_event (event);
 }
 
+
+void stats_event_conv(const char *mount, const char *name, const char *value, const char *charset)
+{
+    const char *metadata = value;
+    xmlBufferPtr conv = xmlBufferCreate ();
+
+    if (charset)
+    {
+        xmlBufferPtr raw = xmlBufferCreate ();
+        xmlCharEncodingHandlerPtr handle = xmlFindCharEncodingHandler (charset);
+
+        xmlBufferPtr conv = xmlBufferCreate ();
+        xmlBufferAdd (raw, (const xmlChar *)value, strlen (value));
+        if (xmlCharEncInFunc (handle, conv, raw) > 0)
+            metadata = xmlBufferContent (conv);
+        xmlFree (raw);
+    }
+
+    stats_event (mount, name, metadata);
+
+    /* special case for title updates, log converted title */
+    if (mount && strcmp (name, "title") == 0)
+    {
+        char *s = stats_get_value ((char*)mount, "listeners");
+        int listeners = 0;
+        if (s)
+            listeners = atoi (s);
+        free (s);
+        logging_playlist (mount, metadata, listeners);
+    }
+    xmlFree (conv);
+}
+
 /* make stat hidden (non-zero). name can be NULL if it applies to a whole
  * source stats tree. */
 void stats_event_hidden (const char *source, const char *name, int hidden)

Modified: icecast/branches/kh/icecast/src/stats.h
===================================================================
--- icecast/branches/kh/icecast/src/stats.h	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/stats.h	2006-04-24 03:15:24 UTC (rev 11267)
@@ -76,6 +76,8 @@
 stats_t *stats_get_stats(void);
 
 void stats_event(const char *source, const char *name, const char *value);
+void stats_event_conv(const char *mount, const char *name,
+        const char *value, const char *charset);
 void stats_event_args(const char *source, char *name, char *format, ...);
 void stats_event_inc(const char *source, const char *name);
 void stats_event_add(const char *source, const char *name, unsigned long value);

Modified: icecast/branches/kh/icecast/src/xslt.c
===================================================================
--- icecast/branches/kh/icecast/src/xslt.c	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/src/xslt.c	2006-04-24 03:15:24 UTC (rev 11267)
@@ -230,6 +230,8 @@
         unsigned int header_len = strlen (mediatype) + len + 100;
         refbuf_t *refbuf = refbuf_new (header_len);
 
+        if (string == NULL)
+            string = xmlStrdup ("");
         len = snprintf (refbuf->data, header_len,
                 "HTTP/1.0 200 OK\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n%s",
                 mediatype, len, string);

Modified: icecast/branches/kh/icecast/web/auth.xsl
===================================================================
--- icecast/branches/kh/icecast/web/auth.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/auth.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
@@ -7,11 +10,11 @@
 <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
 
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Authorization Page</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/navbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/navbar.html" />
 
 <table border="0" width="100%">
 <tr>

Modified: icecast/branches/kh/icecast/web/navbar.html
===================================================================
--- icecast/branches/kh/icecast/web/navbar.html	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/navbar.html	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html>
   <head>
     <link rel="stylesheet" type="text/css" href="/style.css" />
@@ -16,7 +17,7 @@
                 <a href="/admin/stats.xsl" target="_parent">Admin</a>
                 <a href="/status.xsl" target="_parent">Server Status</a>
                 <a href="/server_uptime.xsl" target="_parent">Server Uptime</a>
-                <a href="/server_version.xsl" target="_parent">Version Info</a>
+                <a href="/server_version.xsl" target="_parent">Server Info</a>
               </td>
             </tr>
           </table>

Modified: icecast/branches/kh/icecast/web/server_uptime.xsl
===================================================================
--- icecast/branches/kh/icecast/web/server_uptime.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/server_uptime.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -6,11 +6,11 @@
 <title>Icecast Streaming Media Server</title>
 <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Icecast2 Status (Server Uptime)</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/navbar.html" />
+<iframe frameborder="0" height="50" scrolling="no" src="/navbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">

Modified: icecast/branches/kh/icecast/web/server_version.xsl
===================================================================
--- icecast/branches/kh/icecast/web/server_version.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/server_version.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
@@ -7,17 +10,17 @@
 <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
 
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 <div class="main">
 <h1>Icecast2 Status (Version Info)</h1>
-<iframe scrolling="no" frameborder="0" width="100%" height="100" src="/navbar.html" />
+<iframe frameborder="0" scrolling="no" height="50" src="/navbar.html" />
 
 <div class="roundcont">
 <div class="roundtop">
 <img src="/images/corner_topleft.jpg" class="corner" style="display: none" />
 </div>
 <div class="newscontent">
-<h3>Version Information</h3>
+<h3>Information</h3>
 <table border="0" cellpadding="4">
 <xsl:for-each select="/icestats">
 <xsl:for-each select="server">

Modified: icecast/branches/kh/icecast/web/status.xsl
===================================================================
--- icecast/branches/kh/icecast/web/status.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/status.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <html>
 <head>
@@ -7,26 +10,26 @@
 <link rel="stylesheet" type="text/css" href="style.css" />
 </head>
 
-<body bgcolor="#000" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
+<body>
 
 <div class="main">
 <h1>Icecast2 Status</h1>
-<iframe scrolling="no" frameborder="0" width="100%" src="/navbar.html" />
+<iframe frameborder="0" height="50" scrolling="no" src="/navbar.html" />
 
 <!--mount point stats-->
 <xsl:for-each select="source">
 <div class="roundcont">
 <div class="roundtop">
-<img src="/images/corner_topleft.jpg" class="corner" style="display: none" />
+<img src="/images/corner_topleft.jpg" class="corner" style="display: none" alt=""/>
 </div>
 <div class="newscontent">
 <h3>
 <xsl:choose>
 <xsl:when test="authenticator">
-<a href="/auth.xsl"><img border="0" src="/images/key.png"/></a>
+<a href="/auth.xsl"><img border="0" src="/images/key.png" alt="" /></a>
 </xsl:when>
 <xsl:otherwise>
-<a href="{@mount}.m3u"><img border="0" src="/images/tunein.png"/></a>
+<a href="{@mount}.m3u"><img border="0" src="/images/tunein.png" alt="" /></a>
 </xsl:otherwise>
 </xsl:choose>
 Mount Point : (<xsl:value-of select="@mount" />) :
@@ -81,7 +84,7 @@
 </table>
 </div>
 <div class="roundbottom">
-<img src="/images/corner_bottomleft.jpg" class="corner" style="display: none" />
+<img src="/images/corner_bottomleft.jpg" class="corner" style="display: none" alt="" />
 </div>
 </div>
 <br />

Modified: icecast/branches/kh/icecast/web/style.css
===================================================================
--- icecast/branches/kh/icecast/web/style.css	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/style.css	2006-04-24 03:15:24 UTC (rev 11267)
@@ -13,6 +13,8 @@
 html, body {
 	margin: 0;
 	padding: 0;
+    color: white !important; 
+    background: black;
 }
 
 .xiphnav {
@@ -41,7 +43,6 @@
 .nav a {
     color: white;
 	text-decoration: none;
-    background red;
 }
 .nav a:hover {
 	color: #f8ef64;
@@ -69,6 +70,10 @@
     margin-bottom: 10px;
     background: url(/images/icecast.png) no-repeat left center;
 }
+.main iframe {
+    width: 100%;
+    border: 0;
+}
 .news {
     font-family: Verdana, sans-serif;
     text-decoration: none;
@@ -149,23 +154,23 @@
 	margin: 0 0;
 	font-family: Verdana, sans-serif;
 	text-decoration: none;
-	font-weight: none;
+	font-weight: normal;
 	font-size: 90%;
 }
 .newscontent td {
 	margin: 0 0;
 	font-family: Verdana, sans-serif;
 	text-decoration: none;
-	font-weight: none;
+	font-weight: normal;
 	font-size: 90%;
 }
 .newscontent td.streamdata {
 	margin: 0 0;
 	font-family: Verdana, sans-serif;
 	text-decoration: none;
-	font-weight: none;
+	font-weight: normal;
 	font-size: 90%;
-        color: #f8ef64;
+    color: #f8ef64;
 }
 .newscontent a {
     font-family: Verdana, sans-serif;
@@ -210,7 +215,7 @@
 }
 
 .nav body {
-    color: white
+    color: white;
     background-color: #656565;
 }
 .nav a {
@@ -230,12 +235,6 @@
 	background: url(images/corner_bottomright.jpg) no-repeat top right; 
 }
 
-.logs table {
-    background-color: #656565;
-    color: #fff;
-    font-size: 90%;
-}
-
 .banner td {
     font-size: 150%;
     vertical-align: top;
@@ -267,5 +266,3 @@
 	border: none;
 	display: block !important;
 }
-
-

Modified: icecast/branches/kh/icecast/web/uptime_xml.xsl
===================================================================
--- icecast/branches/kh/icecast/web/uptime_xml.xsl	2006-04-23 05:16:07 UTC (rev 11266)
+++ icecast/branches/kh/icecast/web/uptime_xml.xsl	2006-04-24 03:15:24 UTC (rev 11267)
@@ -1,5 +1,8 @@
 <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" >
-<xsl:output omit-xml-declaration="no" method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="UTF-8" />
+<xsl:output method="xml" media-type="text/html" indent="yes" encoding="UTF-8"
+    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
+
 <xsl:template match = "/icestats" >
 <xsl:for-each select="/icestats">
 <xsl:for-each select="server_start">



More information about the commits mailing list