mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-29 04:25:55 -04:00
sync up work. a couple of places where mount list traversal did not use
the search function. small bits from merge work were found svn path=/icecast/branches/kh/icecast/; revision=9235
This commit is contained in:
parent
98d297a76c
commit
a5b51ecf37
@ -6,7 +6,7 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
SUBDIRS = src conf debian doc web admin win32
|
SUBDIRS = src conf debian doc web admin win32
|
||||||
|
|
||||||
EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
|
EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
|
||||||
m4/theora.m4 m4/vorbis.m4 \
|
m4/theora.m4 m4/vorbis.m4 m4/speex.m4\
|
||||||
m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
|
m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
|
||||||
m4/xiph_types.m4 m4/xiph_xml2.m4 icecast.spec
|
m4/xiph_types.m4 m4/xiph_xml2.m4 icecast.spec
|
||||||
|
|
||||||
|
@ -428,6 +428,13 @@ to a local relay instead
|
|||||||
This optional setting allows for providing a burst size which overrides the default burst size
|
This optional setting allows for providing a burst size which overrides the default burst size
|
||||||
as defined in limits. The value is in bytes.
|
as defined in limits. The value is in bytes.
|
||||||
</div>
|
</div>
|
||||||
|
<h4>mp3-metadata-interval</h4>
|
||||||
|
<div class="indentedbox">
|
||||||
|
This optional setting specifies what interval, in bytes, there is between metadata updates within
|
||||||
|
shoutcast compatible streams. This only applies to new listeners connecting on this mountpoint,
|
||||||
|
not existing listeners falling back to this mountpoint. The default is either the hardcoded
|
||||||
|
server default or the value passed from a relay.
|
||||||
|
</div>
|
||||||
<h4>hidden</h4>
|
<h4>hidden</h4>
|
||||||
<div class="indentedbox">
|
<div class="indentedbox">
|
||||||
Enable this to prevent this mount from being shown on the xsl pages. This is mainly
|
Enable this to prevent this mount from being shown on the xsl pages. This is mainly
|
||||||
|
@ -589,6 +589,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
|
|||||||
mount->max_listeners = atoi(tmp);
|
mount->max_listeners = atoi(tmp);
|
||||||
if(tmp) xmlFree(tmp);
|
if(tmp) xmlFree(tmp);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(node->name, "mp3-metadata-interval") == 0) {
|
||||||
|
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
||||||
|
mount->mp3_meta_interval = atoi(tmp);
|
||||||
|
if(tmp) xmlFree(tmp);
|
||||||
|
}
|
||||||
else if (strcmp(node->name, "fallback-override") == 0) {
|
else if (strcmp(node->name, "fallback-override") == 0) {
|
||||||
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
||||||
mount->fallback_override = atoi(tmp);
|
mount->fallback_override = atoi(tmp);
|
||||||
@ -604,11 +609,6 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
|
|||||||
mount->no_yp = atoi(tmp);
|
mount->no_yp = atoi(tmp);
|
||||||
if(tmp) xmlFree(tmp);
|
if(tmp) xmlFree(tmp);
|
||||||
}
|
}
|
||||||
else if (strcmp(node->name, "mp3-metadata-interval") == 0) {
|
|
||||||
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
|
||||||
mount->mp3_meta_interval = atoi(tmp);
|
|
||||||
if(tmp) xmlFree(tmp);
|
|
||||||
}
|
|
||||||
else if (strcmp(node->name, "hidden") == 0) {
|
else if (strcmp(node->name, "hidden") == 0) {
|
||||||
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
|
||||||
mount->hidden = atoi(tmp);
|
mount->hidden = atoi(tmp);
|
||||||
@ -1027,6 +1027,7 @@ static void _add_server(xmlDocPtr doc, xmlNodePtr node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 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_proxy *mountinfo = config->mounts, *global = NULL;
|
mount_proxy *mountinfo = config->mounts, *global = NULL;
|
||||||
|
@ -640,17 +640,14 @@ int connection_check_source_pass(http_parser_t *parser, const char *mount)
|
|||||||
int ice_login = config->ice_login;
|
int ice_login = config->ice_login;
|
||||||
char *protocol;
|
char *protocol;
|
||||||
|
|
||||||
mount_proxy *mountinfo = config->mounts;
|
mount_proxy *mountinfo = config_find_mount (config, mount);
|
||||||
|
|
||||||
while(mountinfo) {
|
if (mountinfo)
|
||||||
if(!strcmp(mountinfo->mountname, mount)) {
|
{
|
||||||
if(mountinfo->password)
|
if (mountinfo->password)
|
||||||
pass = mountinfo->password;
|
pass = mountinfo->password;
|
||||||
if(mountinfo->username)
|
if (mountinfo->username)
|
||||||
user = mountinfo->username;
|
user = mountinfo->username;
|
||||||
break;
|
|
||||||
}
|
|
||||||
mountinfo = mountinfo->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pass) {
|
if(!pass) {
|
||||||
|
@ -198,7 +198,7 @@ static void format_mp3_apply_settings (client_t *client, format_plugin_t *format
|
|||||||
{
|
{
|
||||||
mp3_state *source_mp3 = format->_state;
|
mp3_state *source_mp3 = format->_state;
|
||||||
|
|
||||||
if (mount->mp3_meta_interval < 0)
|
if (mount->mp3_meta_interval <= 0)
|
||||||
{
|
{
|
||||||
char *metadata = httpp_getvar (client->parser, "icy-metaint");
|
char *metadata = httpp_getvar (client->parser, "icy-metaint");
|
||||||
source_mp3->interval = -1;
|
source_mp3->interval = -1;
|
||||||
|
30
src/source.c
30
src/source.c
@ -152,15 +152,8 @@ source_t *source_find_mount (const char *mount)
|
|||||||
int depth = 0;
|
int depth = 0;
|
||||||
|
|
||||||
config = config_get_config();
|
config = config_get_config();
|
||||||
while (mount != NULL)
|
while (mount && depth < MAX_FALLBACK_DEPTH)
|
||||||
{
|
{
|
||||||
/* limit the number of times through, maybe infinite */
|
|
||||||
if (depth > MAX_FALLBACK_DEPTH)
|
|
||||||
{
|
|
||||||
source = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
source = source_find_mount_raw(mount);
|
source = source_find_mount_raw(mount);
|
||||||
if (source)
|
if (source)
|
||||||
{
|
{
|
||||||
@ -170,20 +163,15 @@ source_t *source_find_mount (const char *mount)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* source is not running, meaning that the fallback is not configured
|
/* we either have a source which is not active (relay) or no source
|
||||||
within the source, we need to check the mount list */
|
* at all. Check the mounts list for fallback settings
|
||||||
mountinfo = config->mounts;
|
*/
|
||||||
|
mountinfo = config_find_mount (config, mount);
|
||||||
source = NULL;
|
source = NULL;
|
||||||
while (mountinfo)
|
|
||||||
{
|
if (mountinfo == NULL)
|
||||||
if (strcmp (mountinfo->mountname, mount) == 0)
|
break;
|
||||||
break;
|
mount = mountinfo->fallback_mount;
|
||||||
mountinfo = mountinfo->next;
|
|
||||||
}
|
|
||||||
if (mountinfo)
|
|
||||||
mount = mountinfo->fallback_mount;
|
|
||||||
else
|
|
||||||
mount = NULL;
|
|
||||||
depth++;
|
depth++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user