[xiph-commits] r18923 - in icecast/branches/ph3/icecast: . doc src
ph3-der-loewe at svn.xiph.org
ph3-der-loewe at svn.xiph.org
Wed Apr 17 02:48:46 PDT 2013
Author: ph3-der-loewe
Date: 2013-04-17 02:48:46 -0700 (Wed, 17 Apr 2013)
New Revision: 18923
Modified:
icecast/branches/ph3/icecast/ChangeLog
icecast/branches/ph3/icecast/configure.in
icecast/branches/ph3/icecast/doc/icecast2_basicsetup.html
icecast/branches/ph3/icecast/doc/icecast2_config_file.html
icecast/branches/ph3/icecast/src/admin.c
icecast/branches/ph3/icecast/src/auth.c
icecast/branches/ph3/icecast/src/auth_url.c
icecast/branches/ph3/icecast/src/cfgfile.c
icecast/branches/ph3/icecast/src/cfgfile.h
icecast/branches/ph3/icecast/src/client.c
icecast/branches/ph3/icecast/src/connection.c
icecast/branches/ph3/icecast/src/format.c
icecast/branches/ph3/icecast/src/logging.c
icecast/branches/ph3/icecast/src/main.c
icecast/branches/ph3/icecast/src/slave.c
icecast/branches/ph3/icecast/src/source.c
icecast/branches/ph3/icecast/src/yp.c
Log:
sync with master
Modified: icecast/branches/ph3/icecast/ChangeLog
===================================================================
--- icecast/branches/ph3/icecast/ChangeLog 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/ChangeLog 2013-04-17 09:48:46 UTC (rev 18923)
@@ -1,3 +1,378 @@
+2013-03-30 10:52 dm8tbr
+
+ * trunk/icecast/ChangeLog:
+ * trunk/icecast/configure.i:
+ This is Icecast 2.4 beta2 (aka 2.3.99.2)
+
+2013-03-30 10:26:44 dm8tbr
+
+ * trunk/icecast/ChangeLog:
+ Updated Icecast ChangeLog
+
+2013-03-30 07:09:14 dm8tbr
+
+ * trunk/icecast/doc/icecast2_config_file.html:
+ Adding "A word of warning" to Icecast config file documentation.
+
+2013-03-29 15:07:33 dm8tbr
+
+ * trunk/icecast/src/connection.c:
+ Highly experimental HTTP PUT support. ref #1812
+ We are handling it the same as we would handle a SOURCE request.
+ Due to legacy code, sender MUST send proper content-type header,
+ if content type is not audio/mpeg!
+ Can be tested using real-time encoded output and piping it into
+
+ | curl -u username:password -H "Content-type: application/ogg" -T - \
+ http://localhost:8000/mountname.ogg
+
+ Note that this example has ZERO timing, so a simple 'cat *.ogg' will
+ fail.
+ Whatever feeds the pipe must do it at proper timing for real-time
+ playback!
+
+2013-03-29 14:41:24 dm8tbr
+
+ * trunk/icecast/src/logging.c:
+ Backing out part of r18755 touching this file.
+ fixes #1942
+
+2013-03-09 15:23:48 dm8tbr
+
+ * trunk/icecast/doc/icecast2_basicsetup.html:
+ Added note about distribution packaging of Icecast, fixing #1249.
+
+2013-02-24 20:12:42 dm8tbr
+
+ * trunk/icecast/doc/icecast2_listenerauth.html:
+ Fixing a small bit in the example that got copied.
+
+2013-02-24 16:19:53 dm8tbr
+
+ * trunk/icecast/doc/icecast2_config_file.html:
+ * trunk/icecast/doc/icecast2_listenerauth.html:
+ Icecast documentation update for stream_auth.
+
+2013-02-24 14:25:37 ph3-der-loewe
+
+ * trunk/icecast/src/admin.c:
+ corrected mime type of plain text mount point list,
+ thanks to cato
+
+2013-02-24 02:04:43 ph3-der-loewe
+
+ * trunk/icecast/src/format_mp3.c:
+ * trunk/icecast/src/util.c:
+ send Expires:-headers on all cache=0 requests, close #1870
+
+2013-02-24 00:53:09 ph3-der-loewe
+
+ * trunk/icecast/src/yp.c:
+ handle yp headers case insensetive, close #1873
+
+2013-02-24 00:41:15 ph3-der-loewe
+
+ * trunk/icecast/doc/icecast2_config_file.html:
+ add info abot usage of strftime(3), see #1823
+
+2013-02-24 00:17:45 ph3-der-loewe
+
+ * trunk/icecast/doc/icecast2_listenerauth.html:
+ updated docs, added additional POST data, see #1422
+
+2013-02-23 20:55:58 ph3-der-loewe
+
+ * trunk/icecast/src/slave.c:
+ Allow full URLs to be returned by the master server. close #1878
+
+2013-02-23 17:51:16 ph3-der-loewe
+
+ * trunk/icecast/src/auth_url.c:
+ Updated listener_remove handler:
+ - added ip= and agent=,
+ - Some cleanup && made code more uniform,
+ - avoid int for size_t vars.
+ actions: close #1422
+
+2013-02-23 17:05:54 ph3-der-loewe
+
+ * trunk/icecast/src/cfgfile.c:
+ format fix
+
+2013-02-23 16:38:23 ph3-der-loewe
+
+ * trunk/icecast/src/cfgfile.c:
+ do not call xmlCleanupParser() too often, close #1931
+
+2013-01-16 12:03:03 ph3-der-loewe
+
+ * trunk/icecast/src/shout.c:
+ * trunk/icecast/src/util.c:
+ Replaced usage of sprintf() with snprintf().
+
+2013-01-16 12:02:14 ph3-der-loewe
+
+ * trunk/icecast/src/avl/avl.c:
+ * trunk/icecast/src/avl/avl.h:
+ Replaced usage of sprintf() with snprintf(). Also exported size of key
+ printer's buffer in avl/.
+
+2013-01-02 14:44:43 ph3-der-loewe
+
+ * trunk/icecast/src/log/log.c:
+ * trunk/icecast/src/log/log.h:
+ Escape log entries in access log (close: #1916)
+
+2013-01-02 14:44:08 ph3-der-loewe
+
+ * trunk/icecast/src/cfgfile.c:
+ * trunk/icecast/src/logging.c:
+ Escape log entries in access log (close: #1916)
+
+2012-11-13 14:40:48 ph3-der-loewe
+
+ * trunk/icecast/src/admin.c:
+ corrected Content-Length: header in admin (raw) requests. Thanks to
+ paluh for reporting.
+
+2012-11-13 11:25:46 ph3-der-loewe
+
+ * trunk/icecast/src/sighandler.h:
+ cleanup unused var schedule_config_reread.
+
+2012-11-12 21:01:57 ph3-der-loewe
+
+ * trunk/icecast/src/main.c:
+ correction for win32 build to avoid segfault if build with mingw.
+
+2012-10-14 23:50:15 ph3-der-loewe
+
+ * trunk/icecast/src/source.c:
+ corrected coding style
+
+2012-10-14 21:36:10 ph3-der-loewe
+
+ * trunk/icecast/src/cfgfile.c:
+ removed useless blank line
+
+2012-10-12 14:41:12 ph3-der-loewe
+
+ * trunk/icecast/:
+ removed \r at end of lines
+
+2012-10-11 22:54:53 ph3-der-loewe
+
+ * trunk/icecast/src/auth_url.c:
+ * trunk/icecast/src/cfgfile.c:
+ * trunk/icecast/src/client.c:
+ * trunk/icecast/src/client.h:
+ * trunk/icecast/src/format_mp3.c:
+ * trunk/icecast/src/logging.c:
+ * trunk/icecast/src/main.c:
+ * trunk/icecast/src/sighandler.c:
+ * trunk/icecast/src/util.c:
+ updated copyright notices.
+
+2012-10-11 22:49:57 ph3-der-loewe
+
+ * trunk/icecast/src/client.c:
+ * trunk/icecast/src/client.h:
+ * trunk/icecast/src/format_mp3.c:
+ * trunk/icecast/src/main.c:
+ * trunk/icecast/src/sighandler.c:
+ avoid compiler warnings;
+ send /message/ in case of 403.
+
+2012-10-11 22:28:40 ph3-der-loewe
+
+ * trunk/icecast/src/cfgfile.c:
+ cleanup of <source-password> parser code
+
+2012-10-11 18:06:30 ph3-der-loewe
+
+ * trunk/icecast/conf/icecast.xml.in
+ * trunk/icecast/doc/icecast2_listenerauth.html
+ * trunk/icecast/src/auth_url.c:
+ Added options "headers" and "header_prefix" to URL based listener
+ auth.
+ Someone should update the docs/ text to good english.
+
+2012-10-11 00:26:38 ph3-der-loewe
+
+ * trunk/icecast/configure.in:
+ * trunk/icecast/src/main.c:
+ Fix win32 patches (r18642) so it builds corectly on non-win32 again.
+
+2012-10-10 23:34:54 ph3-der-loewe
+
+ * trunk/icecast/src/xslt.c:
+ use correct prototype.
+
+2012-10-10 23:15:05 ph3-der-loewe
+
+ * trunk/icecast/src/client.c:
+ Improved handling of HTTP client errors:
+ - Make the internal API more uniform,
+ - Improved error pages slightly (See: #1889).
+
+2012-10-10 22:48:15 ph3-der-loewe
+
+ * trunk/icecast/src/connection.c:
+ * trunk/icecast/src/fserve.c:
+ Make some more vars local (static).
+
+2012-10-10 22:41:30 ph3-der-loewe
+
+ * trunk/icecast/configure.in:
+ * trunk/icecast/src/logging.c:
+ * trunk/icecast/src/main.c:
+ * trunk/icecast/src/util.c:
+ fixes for win32 (ported 2.3.99.0 patches).
+ Thanks to LRN (from mailing list).
+
+2012-07-31 23:09:42 ph3-der-loewe
+
+ * trunk/icecast/src/log/log.c:
+ Corrected check for the value of priority to be within
+ valid range.
+
+2012-07-18 01:40:55 ph3-der-loewe
+
+ * trunk/icecast/src/format.c:
+ remove unused variable "ice_config_t *config" from
+ format_prepare_headers()
+
+2012-07-17 23:55:09 ph3-der-loewe
+
+ * trunk/icecast/src/admin.c:
+ * trunk/icecast/src/client.c:
+ * trunk/icecast/src/format.c:
+ * trunk/icecast/src/fserve.c:
+ * trunk/icecast/src/util.c:
+ * trunk/icecast/src/util.h:
+ * trunk/icecast/src/xslt.c:
+ Send proper HTTP headers in responses to clients.
+ This is currently not implemented for SOURCE and STATS clients as
+ I suspect to break them. This needs some more research.
+ close #1639, see #1870 and #1885.
+
+2012-07-17 21:35:31 dm8tbr
+
+ * tags/icecast/icecast-2.4-beta:
+ Release of Icecast 2.4 beta1 (2.3.99.0)
+
+2012-07-17 21:24:45 dm8tbr
+
+ * trunk/icecast/src/source.c:
+ Adding limits.h to fix build problems on e.g. newer glibc.
+
+2012-07-17 20:46:06 dm8tbr
+
+ * trunk/icecast/NEWS:
+ * trunk/icecast/configure.in:
+ Updated NEWS for Icecast 2.3.3 and 2.4-beta.
+ Changed version to report as 2.3.99.0 for 2.4-beta release
+
+2012-07-17 14:42:16 ph3-der-loewe
+
+ * trunk/icecast/src/source.c:
+ Allow (standard strftime(3)) %x codes in mount's <dump-file> to embedd
+ timestamps in filenames. This currently only works on non windows.
+ closes #1823
+
+2012-07-17 14:03:37 ph3-der-loewe
+
+ * trunk/icecast/src/connection.c:
+ * trunk/icecast/src/sighandler.c:
+ * trunk/icecast/src/slave.c:
+ * trunk/icecast/src/source.c:
+ * trunk/icecast/src/source.h:
+ * trunk/icecast/src/stats.c:
+ race condition patch as submitted by lds and remi, slightly modified
+ by me. closes #1810
+
+2012-07-16 16:05:21 ph3-der-loewe
+
+ * trunk/icecast/httpp/httpp.c:
+ * trunk/icecast/httpp/httpp.h:
+ commited support for HTTP PUT, See #1812
+
+2012-06-13 21:11:07 giles
+
+ * trunk/icecast/AUTHORS:
+ * trunk/icecast/NEWS:
+ * trunk/icecast/src/Makefile.am:
+ * trunk/icecast/src/format_ogg.c:
+ * trunk/icecast/src/format_opus.c:
+ * trunk/icecast/src/format_opus.h:
+ Add WebM support.
+ This is David Richard's webm support patch from the icecast-webm
+ branch.
+ Mention Opus and WebM support in NEWS.
+
+2012-06-13 19:56:58 dm8tbr
+
+ * trunk/icecast/:
+ Removed outdated debian packaging, not used by downstream anyway.
+
+2012-06-11 20:06:32 dm8tbr
+
+ * trunk/icecast/configure.in:
+ Reset version string to 'trunk'.
+
+2012-06-11 16:43:54 dm8tbr
+
+ * tags/icecast_2_3_3:
+ Icecast release, version 2.3.3
+
+
+2012-06-10 20:09:59 dm8tbr
+
+ * trunk/icecast/doc/icecast2_win32.html:
+ * trunk/icecast/doc/index_win32.html:
+ Added note about missing IPv6 support on Win32. cf. #1877
+
+2012-06-10 13:06:03 dm8tbr
+
+ * trunk/icecast/configure.in:
+ set 2.3.3 version in preparation for release
+
+2012-06-10 12:35:47 dm8tbr
+
+ * trunk/icecast/web/status.xsl:
+ Hide VCLT from status.xsl for now as agreed earlier.
+ VCLT support remains unchanged for users that want to use it.
+ Just use the URL: {@mount}.vclt
+
+2012-06-07 18:27:58 ph3-der-loewe
+
+ * trunk/icecast/log/log.c:
+ support field width with (most common) %Ns and %NH syntax.
+
+2012-06-07 18:13:28 ph3-der-loewe
+
+ * trunk/icecast/log/log.c:
+ honor field width in %s and %H
+
+2012-06-07 18:09:48 ph3-der-loewe
+
+ * trunk/icecast/log/log.c:
+ consider backticks as well as backslashes invalid chars
+
+2012-06-07 15:57 dm8tbr
+
+ * trunk/icecast/format_mp3.c:
+ * trunk/icecast/fserve.c:
+ * trunk/icecast/log/log.c:
+ Patchset to properly address CVE-2011-4612
+
+2011-12-03 09:25 dm8tbr
+
+ * trunk/icecast/doc/icecast2_config_file.html:
+ Added 'admin' and 'location' to documentation
+ Added clarification to the 'username' attribute of a mount
+ Fixed typos
+
2011-11-26 11:11 ph3-der-loewe
* trunk/icecast/admin/Makefile.am: Added vclt.xsl to list
Modified: icecast/branches/ph3/icecast/configure.in
===================================================================
--- icecast/branches/ph3/icecast/configure.in 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/configure.in 2013-04-17 09:48:46 UTC (rev 18923)
@@ -1,4 +1,4 @@
-AC_INIT([Icecast], [2.3.99.0-ph3], [icecast at xiph.org])
+AC_INIT([Icecast], [2.3.99.2-ph3], [icecast at xiph.org])
AC_PREREQ(2.54)
AC_CONFIG_SRCDIR(src/main.c)
Modified: icecast/branches/ph3/icecast/doc/icecast2_basicsetup.html
===================================================================
--- icecast/branches/ph3/icecast/doc/icecast2_basicsetup.html 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/doc/icecast2_basicsetup.html 2013-04-17 09:48:46 UTC (rev 18923)
@@ -15,7 +15,7 @@
<br />
</p>
<h2>Basic Requirements</h2>
-<p>This section will describe the essential requirements in setting up a simple Internet radio station. It is by no means a complete list but should give you enough to get started.</p>
+<p>This section will describe the essential requirements in setting up a simple Internet radio station. It is by no means a complete list but should give you enough to get started. Please also note that those are generic instructions. If you installed a Linux/Unix distribution package, then it will likely come with different paths, different means of starting it, etc. In that case please also refer to the documentation of that distribution and or a distribution specific HowTo.</p>
<p>There are two major components involved: the streaming server (icecast in this case) and the source client. The icecast server will be the place where all listeners of your station will connect. The source client (in general) runs on a separate machine than icecast, but does not necessarily need to. Source clients send the content to icecast and provide the stream data (encoded audio) that is then relayed out to listeners by icecast.</p>
<p>It is important to note that not all source clients work with icecast2. You will need to check to make sure that icecast2 is supported by your chosen source client.</p>
<p>
Modified: icecast/branches/ph3/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/branches/ph3/icecast/doc/icecast2_config_file.html 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/doc/icecast2_config_file.html 2013-04-17 09:48:46 UTC (rev 18923)
@@ -29,6 +29,20 @@
<br />
<br />
</p>
+<h2>A word of warning</h2>
+<p>
+Please note that, especially for new Icecast users, editing the config file can be quite tricky. <strong>It is thus recommended to start by just changing all passwords, nothing else.</strong> You can then use the source-password to bring up an initial stream and get more comfortable with how Icecast works.
+</p>
+<p>
+Should you need to customize the configuration, then make a backup of your working config file, before you make any changes. If Icecast refuses to start it is in most cases due to a malformed config file. In such a case running the following command should point out most XML syntax problems.
+<pre>xmllint icecast.xml</pre>
+Also check the Icecast error.log for additional hints.
+</p>
+<p>
+<br />
+<br />
+<br />
+</p>
<a name="limits"></a>
<h2>Limits</h2>
<pre>
Modified: icecast/branches/ph3/icecast/src/admin.c
===================================================================
--- icecast/branches/ph3/icecast/src/admin.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/admin.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -236,7 +236,7 @@
xmlNewChild(srcnode, NULL, XMLSTR("listeners"), XMLSTR(buf));
config = config_get_config();
- mountinfo = config_find_mount (config, source->mount);
+ mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo && mountinfo->auth)
{
xmlNewChild(srcnode, NULL, XMLSTR("authenticator"),
@@ -742,7 +742,7 @@
char *message = NULL;
int ret = AUTH_OK;
ice_config_t *config = config_get_config ();
- mount_proxy *mountinfo = config_find_mount (config, source->mount);
+ mount_proxy *mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
do
{
Modified: icecast/branches/ph3/icecast/src/auth.c
===================================================================
--- icecast/branches/ph3/icecast/src/auth.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/auth.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -485,7 +485,7 @@
client_t *client = auth_user->client;
ice_config_t *config = config_get_config();
- mount_proxy *mountinfo = config_find_mount (config, auth_user->mount);
+ mount_proxy *mountinfo = config_find_mount (config, auth_user->mount, MOUNT_TYPE_NORMAL);
ret = add_authenticated_listener (auth_user->mount, mountinfo, client);
config_release_config();
@@ -530,7 +530,7 @@
mount_proxy *mountinfo;
ice_config_t *config = config_get_config();
- mountinfo = config_find_mount (config, mount);
+ mountinfo = config_find_mount (config, mount, MOUNT_TYPE_NORMAL);
if (mountinfo && mountinfo->no_mount)
{
config_release_config ();
Modified: icecast/branches/ph3/icecast/src/auth_url.c
===================================================================
--- icecast/branches/ph3/icecast/src/auth_url.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/auth_url.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -412,7 +412,7 @@
{
char *mount, *server;
ice_config_t *config = config_get_config ();
- mount_proxy *mountinfo = config_find_mount (config, auth_user->mount);
+ mount_proxy *mountinfo = config_find_mount (config, auth_user->mount, MOUNT_TYPE_NORMAL);
auth_t *auth = mountinfo->auth;
auth_url *url = auth->state;
char *stream_start_url;
@@ -464,7 +464,7 @@
{
char *mount, *server;
ice_config_t *config = config_get_config ();
- mount_proxy *mountinfo = config_find_mount (config, auth_user->mount);
+ mount_proxy *mountinfo = config_find_mount (config, auth_user->mount, MOUNT_TYPE_NORMAL);
auth_t *auth = mountinfo->auth;
auth_url *url = auth->state;
char *stream_end_url;
Modified: icecast/branches/ph3/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/ph3/icecast/src/cfgfile.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/cfgfile.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <fnmatch.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
@@ -91,6 +92,9 @@
static void _add_server(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_plugins(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
+static void merge_mounts(mount_proxy * dst, mount_proxy * src);
+static inline void _merge_mounts_all(ice_config_t *c);
+
static void create_locks(void) {
thread_mutex_create(&_locks.relay_lock);
thread_rwlock_create(&_locks.config_lock);
@@ -329,6 +333,8 @@
xmlFreeDoc(doc);
+ _merge_mounts_all(configuration);
+
return 0;
}
@@ -500,7 +506,7 @@
} else if (xmlStrcmp (node->name, XMLSTR("relay")) == 0) {
_parse_relay(doc, node->xmlChildrenNode, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("mount")) == 0) {
- _parse_mount(doc, node->xmlChildrenNode, configuration);
+ _parse_mount(doc, node, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("directory")) == 0) {
_parse_directory(doc, node->xmlChildrenNode, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("paths")) == 0) {
@@ -582,12 +588,30 @@
mount_proxy *last=NULL;
/* default <mount> settings */
+ mount->mounttype = MOUNT_TYPE_NORMAL;
mount->max_listeners = -1;
mount->burst_size = -1;
mount->mp3_meta_interval = -1;
mount->yp_public = -1;
mount->next = NULL;
+ tmp = (char *)xmlGetProp(node, XMLSTR("type"));
+ if (tmp) {
+ if (strcmp(tmp, "normal") == 0) {
+ mount->mounttype = MOUNT_TYPE_NORMAL;
+ }
+ else if (strcmp(tmp, "default") == 0) {
+ mount->mounttype = MOUNT_TYPE_DEFAULT;
+ }
+ else {
+ WARN1("Unknown mountpoint type: %s", tmp);
+ config_clear_mount (mount);
+ return;
+ }
+ }
+
+ node = node->xmlChildrenNode;
+
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
@@ -718,7 +742,7 @@
} while ((node = node->next));
/* make sure we have at least the mountpoint name */
- if (mount->mountname == NULL)
+ if (mount->mountname == NULL && mount->mounttype != MOUNT_TYPE_DEFAULT)
{
config_clear_mount (mount);
return;
@@ -1264,18 +1288,109 @@
}
}
+static void merge_mounts(mount_proxy * dst, mount_proxy * src) {
+ if (!dst || !src)
+ return;
+ if (!dst->username)
+ dst->username = (char*)xmlStrdup((xmlChar*)src->username);
+ if (!dst->password)
+ dst->password = (char*)xmlStrdup((xmlChar*)src->password);
+ if (!dst->dumpfile)
+ dst->dumpfile = (char*)xmlStrdup((xmlChar*)src->dumpfile);
+ if (!dst->intro_filename)
+ dst->intro_filename = (char*)xmlStrdup((xmlChar*)src->intro_filename);
+ if (!dst->fallback_when_full)
+ dst->fallback_when_full = src->fallback_when_full;
+ if (dst->max_listeners == -1)
+ dst->max_listeners = src->max_listeners;
+ if (!dst->fallback_mount)
+ dst->fallback_mount = (char*)xmlStrdup((xmlChar*)src->fallback_mount);
+ if (!dst->fallback_override)
+ dst->fallback_override = src->fallback_override;
+ if (!dst->no_mount)
+ dst->no_mount = src->no_mount;
+ if (dst->burst_size == -1)
+ dst->burst_size = src->burst_size;
+ if (!dst->queue_size_limit)
+ dst->queue_size_limit = src->queue_size_limit;
+ if (!dst->hidden)
+ dst->hidden = src->hidden;
+ if (!dst->source_timeout)
+ dst->source_timeout = src->source_timeout;
+ if (!dst->charset)
+ dst->charset = (char*)xmlStrdup((xmlChar*)src->charset);
+ if (dst->mp3_meta_interval == -1)
+ dst->mp3_meta_interval = src->mp3_meta_interval;
+ if (!dst->auth_type)
+ dst->auth_type = (char*)xmlStrdup((xmlChar*)src->auth_type);
+ // TODO: dst->auth
+ if (!dst->cluster_password)
+ dst->cluster_password = (char*)xmlStrdup((xmlChar*)src->cluster_password);
+ // TODO: dst->auth_options
+ if (!dst->on_connect)
+ dst->on_connect = (char*)xmlStrdup((xmlChar*)src->on_connect);
+ if (!dst->on_disconnect)
+ dst->on_disconnect = (char*)xmlStrdup((xmlChar*)src->on_disconnect);
+ if (!dst->max_listener_duration)
+ dst->max_listener_duration = src->max_listener_duration;
+ if (!dst->stream_name)
+ dst->stream_name = (char*)xmlStrdup((xmlChar*)src->stream_name);
+ if (!dst->stream_description)
+ dst->stream_description = (char*)xmlStrdup((xmlChar*)src->stream_description);
+ if (!dst->stream_url)
+ dst->stream_url = (char*)xmlStrdup((xmlChar*)src->stream_url);
+ if (!dst->stream_genre)
+ dst->stream_genre = (char*)xmlStrdup((xmlChar*)src->stream_genre);
+ if (!dst->bitrate)
+ dst->bitrate = (char*)xmlStrdup((xmlChar*)src->bitrate);
+ if (!dst->type)
+ dst->type = (char*)xmlStrdup((xmlChar*)src->type);
+ if (!dst->subtype)
+ dst->subtype = (char*)xmlStrdup((xmlChar*)src->subtype);
+ if (dst->yp_public == -1)
+ dst->yp_public = src->yp_public;
+}
+
+static inline void _merge_mounts_all(ice_config_t *c) {
+ mount_proxy *mountinfo = c->mounts;
+ mount_proxy *default_mount;
+
+ for (; mountinfo; mountinfo = mountinfo->next)
+ {
+ if (mountinfo->mounttype != MOUNT_TYPE_NORMAL)
+ continue;
+
+ default_mount = config_find_mount(c, mountinfo->mountname, MOUNT_TYPE_DEFAULT);
+
+ merge_mounts(mountinfo, default_mount);
+ }
+}
+
/* return the mount details that match the supplied mountpoint */
-mount_proxy *config_find_mount (ice_config_t *config, const char *mount)
+mount_proxy *config_find_mount (ice_config_t *config, const char *mount, mount_type type)
{
mount_proxy *mountinfo = config->mounts;
- while (mountinfo)
+ for (; mountinfo; mountinfo = mountinfo->next)
{
- if (strcmp (mountinfo->mountname, mount) == 0)
+ if (mountinfo->mounttype != type)
+ continue;
+
+ if (mount == NULL || mountinfo->mountname == NULL)
break;
- mountinfo = mountinfo->next;
+
+ if (mountinfo->mounttype == MOUNT_TYPE_NORMAL && strcmp (mountinfo->mountname, mount) == 0)
+ break;
+
+ if (fnmatch(mountinfo->mountname, mount, FNM_PATHNAME) == 0)
+ break;
}
+
+ /* retry with default mount */
+ if (!mountinfo && type == MOUNT_TYPE_NORMAL)
+ mountinfo = config_find_mount(config, mount, MOUNT_TYPE_DEFAULT);
+
return mountinfo;
}
Modified: icecast/branches/ph3/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/ph3/icecast/src/cfgfile.h 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/cfgfile.h 2013-04-17 09:48:46 UTC (rev 18923)
@@ -45,9 +45,16 @@
struct _config_options *next;
} config_options_t;
+typedef enum _mount_type {
+ MOUNT_TYPE_NORMAL,
+ MOUNT_TYPE_DEFAULT
+} mount_type;
+
typedef struct _mount_proxy {
char *mountname; /* The mountpoint this proxy is used for */
+ mount_type mounttype; /* The type of the mount point */
+
char *username; /* Username and password for this mountpoint. If unset, */
char *password; /* falls back to global source password */
@@ -216,7 +223,7 @@
void config_set_config(ice_config_t *config);
listener_t *config_clear_listener (listener_t *listener);
void config_clear(ice_config_t *config);
-mount_proxy *config_find_mount (ice_config_t *config, const char *mount);
+mount_proxy *config_find_mount (ice_config_t *config, const char *mount, mount_type type);
listener_t *config_get_listen_sock (ice_config_t *config, connection_t *con);
int config_rehash(void);
Modified: icecast/branches/ph3/icecast/src/client.c
===================================================================
--- icecast/branches/ph3/icecast/src/client.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/client.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -133,7 +133,7 @@
char *pass = config->source_password;
char *user = "source";
int ret = -1;
- mount_proxy *mountinfo = config_find_mount (config, mount);
+ mount_proxy *mountinfo = config_find_mount (config, mount, MOUNT_TYPE_NORMAL);
do
{
Modified: icecast/branches/ph3/icecast/src/connection.c
===================================================================
--- icecast/branches/ph3/icecast/src/connection.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/connection.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -851,7 +851,7 @@
global_unlock();
source->running = 1;
- mountinfo = config_find_mount (config, source->mount);
+ mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
source_update_settings (config, source, mountinfo);
config_release_config();
slave_rebuild_mounts();
@@ -1178,7 +1178,7 @@
if (node->shoutcast == 1)
{
char *source_password, *ptr, *headers;
- mount_proxy *mountinfo = config_find_mount (config, shoutcast_mount);
+ mount_proxy *mountinfo = config_find_mount (config, shoutcast_mount, MOUNT_TYPE_NORMAL);
if (mountinfo && mountinfo->password)
source_password = strdup (mountinfo->password);
@@ -1344,7 +1344,7 @@
continue;
}
- if (parser->req_type == httpp_req_source) {
+ if (parser->req_type == httpp_req_source || parser->req_type == httpp_req_put) {
_handle_source_request (client, uri);
}
else if (parser->req_type == httpp_req_stats) {
Modified: icecast/branches/ph3/icecast/src/format.c
===================================================================
--- icecast/branches/ph3/icecast/src/format.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/format.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -339,7 +339,7 @@
mount_proxy *mountinfo;
config = config_get_config();
- mountinfo = config_find_mount (config, source->mount);
+ mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo && mountinfo->stream_name)
bytes = snprintf (ptr, remaining, "icy-name:%s\r\n", mountinfo->stream_name);
Modified: icecast/branches/ph3/icecast/src/logging.c
===================================================================
--- icecast/branches/ph3/icecast/src/logging.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/logging.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -120,7 +120,6 @@
void logging_access(client_t *client)
{
char datebuf[128];
- char reqbuf[1024];
struct tm thetime;
time_t now;
time_t stayed;
@@ -136,12 +135,6 @@
#else
strftime (datebuf, sizeof(datebuf), LOGGING_FORMAT_CLF, &thetime);
#endif
- /* build the request */
- snprintf (reqbuf, sizeof(reqbuf), "%s %s %s/%s",
- httpp_getvar (client->parser, HTTPP_VAR_REQ_TYPE),
- httpp_getvar (client->parser, HTTPP_VAR_URI),
- httpp_getvar (client->parser, HTTPP_VAR_PROTOCOL),
- httpp_getvar (client->parser, HTTPP_VAR_VERSION));
stayed = now - client->con->con_time;
@@ -159,11 +152,14 @@
user_agent = "-";
log_write_direct (accesslog,
- "%s - %H [%s] \"%H\" %d %" PRIu64 " \"%H\" \"%H\" %lu",
+ "%s - %H [%s] \"%H %H %H/%H\" %d %" PRIu64 " \"% H\" \"% H\" %lu",
client->con->ip,
username,
datebuf,
- reqbuf,
+ httpp_getvar (client->parser, HTTPP_VAR_REQ_TYPE),
+ httpp_getvar (client->parser, HTTPP_VAR_URI),
+ httpp_getvar (client->parser, HTTPP_VAR_PROTOCOL),
+ httpp_getvar (client->parser, HTTPP_VAR_VERSION),
client->respcode,
client->con->sent_bytes,
referrer,
Modified: icecast/branches/ph3/icecast/src/main.c
===================================================================
--- icecast/branches/ph3/icecast/src/main.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/main.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -78,7 +78,7 @@
static int background;
static char *pidfile = NULL;
-static void _fatal_error(char *perr)
+static void _fatal_error(const char *perr)
{
#ifdef WIN32_SERVICE
MessageBox(NULL, perr, "Error", MB_SERVICE_NOTIFICATION);
@@ -92,11 +92,12 @@
static void _print_usage(void)
{
printf("%s\n\n", ICECAST_VERSION_STRING);
- printf("usage: icecast [-b -v] -c <file>\n");
+ printf("usage: icecast [-b] -c <file>\n");
+ printf("or : icecast {-v|--version}\n");
printf("options:\n");
- printf("\t-c <file>\tSpecify configuration file\n");
- printf("\t-v\t\tDisplay version info\n");
- printf("\t-b\t\tRun icecast in the background\n");
+ printf("\t-c <file> Specify configuration file\n");
+ printf("\t-v or --version Display version info\n");
+ printf("\t-b Run icecast in the background\n");
printf("\n");
}
@@ -184,7 +185,7 @@
FreeConsole();
#endif
}
- if (strcmp(argv[i], "-v") == 0) {
+ if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) {
fprintf(stdout, "%s\n", ICECAST_VERSION_STRING);
exit(0);
}
Modified: icecast/branches/ph3/icecast/src/slave.c
===================================================================
--- icecast/branches/ph3/icecast/src/slave.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/slave.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -407,7 +407,7 @@
if (relay->on_demand)
{
ice_config_t *config = config_get_config ();
- mount_proxy *mountinfo = config_find_mount (config, relay->localmount);
+ mount_proxy *mountinfo = config_find_mount (config, relay->localmount, MOUNT_TYPE_NORMAL);
if (mountinfo == NULL)
source_update_settings (config, relay->source, mountinfo);
config_release_config ();
@@ -474,7 +474,7 @@
if (relay->on_demand && relay->source)
{
ice_config_t *config = config_get_config ();
- mount_proxy *mountinfo = config_find_mount (config, relay->localmount);
+ mount_proxy *mountinfo = config_find_mount (config, relay->localmount, MOUNT_TYPE_NORMAL);
source_update_settings (config, relay->source, mountinfo);
config_release_config ();
stats_event (relay->localmount, "listeners", "0");
Modified: icecast/branches/ph3/icecast/src/source.c
===================================================================
--- icecast/branches/ph3/icecast/src/source.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/source.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -170,7 +170,7 @@
/* we either have a source which is not active (relay) or no source
* at all. Check the mounts list for fallback settings
*/
- mountinfo = config_find_mount (config, mount);
+ mountinfo = config_find_mount (config, mount, MOUNT_TYPE_NORMAL);
source = NULL;
if (mountinfo == NULL)
@@ -662,7 +662,7 @@
source->prev_listeners = -1;
source->running = 1;
- mountinfo = config_find_mount (config_get_config(), source->mount);
+ mountinfo = config_find_mount (config_get_config(), source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo)
{
if (mountinfo->on_connect)
@@ -870,7 +870,7 @@
source->running = 0;
INFO1("Source \"%s\" exiting", source->mount);
- mountinfo = config_find_mount (config_get_config(), source->mount);
+ mountinfo = config_find_mount (config_get_config(), source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo)
{
if (mountinfo->on_disconnect)
@@ -1423,8 +1423,11 @@
if (update_all)
stats_clear_virtual_mounts ();
- while (mount)
+ for (; mount; mount = mount->next)
{
+ if (mount->mounttype != MOUNT_TYPE_NORMAL)
+ continue;
+
source_t *source = source_find_mount (mount->mountname);
if (source)
@@ -1432,7 +1435,7 @@
source = source_find_mount_raw (mount->mountname);
if (source)
{
- mount_proxy *mountinfo = config_find_mount (config, source->mount);
+ mount_proxy *mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
source_update_settings (config, source, mountinfo);
}
else if (update_all)
@@ -1460,8 +1463,6 @@
strdup (mount->fallback_mount), THREAD_DETACHED);
}
}
-
- mount = mount->next;
}
avl_tree_unlock (global.source_tree);
config_release_config();
Modified: icecast/branches/ph3/icecast/src/yp.c
===================================================================
--- icecast/branches/ph3/icecast/src/yp.c 2013-04-14 12:03:13 UTC (rev 18922)
+++ icecast/branches/ph3/icecast/src/yp.c 2013-04-17 09:48:46 UTC (rev 18923)
@@ -593,7 +593,7 @@
snprintf (url, ret, "http://%s:%d%s", config->hostname, config->port, mount);
}
- mountproxy = config_find_mount (config, mount);
+ mountproxy = config_find_mount (config, mount, MOUNT_TYPE_NORMAL);
if (mountproxy && mountproxy->cluster_password)
add_yp_info (yp, mountproxy->cluster_password, YP_CLUSTER_PASSWORD);
config_release_config();
More information about the commits
mailing list