mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -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,
|
||||
"HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
|
||||
|
||||
avl_node *node = avl_get_first(global.source_tree);
|
||||
while (node && ret > 0 && (unsigned)ret < remaining)
|
||||
ice_config_t *config = config_get_config ();
|
||||
mount_proxy *mountinfo = config->mounts;
|
||||
while (mountinfo)
|
||||
{
|
||||
source_t *source = (source_t *)node->key;
|
||||
node = avl_get_next(node);
|
||||
if (source->hidden || source->running == 0)
|
||||
mount_proxy *current = mountinfo;
|
||||
source_t *source;
|
||||
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;
|
||||
remaining -= 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);
|
||||
config_release_config();
|
||||
|
||||
/* handle last line */
|
||||
if (ret > 0 && (unsigned)ret < remaining)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user