mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
from branch. make streamlist.txt from the mount list, so that fallback handling
can be taken into account. If we just use the source tree then entries can disappear causing a relay to shutdown in the slave. svn path=/icecast/trunk/icecast/; revision=9213
This commit is contained in:
parent
8e99b390f2
commit
acc79b778f
24
src/admin.c
24
src/admin.c
@ -973,18 +973,30 @@ static void command_list_mounts(client_t *client, int response)
|
|||||||
int ret = snprintf (buffer, remaining,
|
int ret = snprintf (buffer, remaining,
|
||||||
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
|
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
|
||||||
|
|
||||||
avl_node *node = avl_get_first(global.source_tree);
|
ice_config_t *config = config_get_config ();
|
||||||
while (node && ret > 0 && (unsigned)ret < remaining)
|
mount_proxy *mountinfo = config->mounts;
|
||||||
|
while (mountinfo)
|
||||||
{
|
{
|
||||||
source_t *source = (source_t *)node->key;
|
mount_proxy *current = mountinfo;
|
||||||
node = avl_get_next(node);
|
source_t *source;
|
||||||
if (source->hidden || source->running == 0)
|
mountinfo = mountinfo->next;
|
||||||
|
|
||||||
|
/* now check that a source is available */
|
||||||
|
source = source_find_mount (current->mountname);
|
||||||
|
|
||||||
|
if (source == NULL)
|
||||||
|
continue;
|
||||||
|
if (source->running == 0)
|
||||||
|
continue;
|
||||||
|
if (source->hidden)
|
||||||
continue;
|
continue;
|
||||||
remaining -= ret;
|
remaining -= ret;
|
||||||
buf += ret;
|
buf += ret;
|
||||||
ret = snprintf (buf, remaining, "%s\n", source->mount);
|
ret = snprintf (buf, remaining, "%s\n", current->mountname);
|
||||||
}
|
}
|
||||||
avl_tree_unlock (global.source_tree);
|
avl_tree_unlock (global.source_tree);
|
||||||
|
config_release_config();
|
||||||
|
|
||||||
/* handle last line */
|
/* handle last line */
|
||||||
if (ret > 0 && (unsigned)ret < remaining)
|
if (ret > 0 && (unsigned)ret < remaining)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user