1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Added identifier to source_t

This commit is contained in:
Philipp Schafft 2020-10-24 08:06:08 +00:00
parent 673dfb734c
commit 31659b3ed1
2 changed files with 5 additions and 1 deletions

View File

@ -60,6 +60,7 @@
#include "event.h" #include "event.h"
#include "slave.h" #include "slave.h"
#include "acl.h" #include "acl.h"
#include "navigation.h"
#undef CATMODULE #undef CATMODULE
#define CATMODULE "source" #define CATMODULE "source"
@ -105,6 +106,7 @@ source_t *source_reserve (const char *mount)
/* make duplicates for strings or similar */ /* make duplicates for strings or similar */
src->mount = strdup(mount); src->mount = strdup(mount);
src->identifier = mount_identifier_new(mount);
src->max_listeners = -1; src->max_listeners = -1;
thread_mutex_create(&src->lock); thread_mutex_create(&src->lock);
@ -315,6 +317,7 @@ void source_free_source (source_t *source)
/* make sure all YP entries have gone */ /* make sure all YP entries have gone */
yp_remove (source->mount); yp_remove (source->mount);
refobject_unref(source->identifier);
free (source->mount); free (source->mount);
free (source); free (source);

View File

@ -33,7 +33,8 @@ struct source_tag {
http_parser_t *parser; http_parser_t *parser;
time_t client_stats_update; time_t client_stats_update;
char *mount; char *mount; // TODO: Should we at some point migrate away from this to only use identifier?
mount_identifier_t *identifier;
/* If this source drops, try to move all clients to this fallback */ /* If this source drops, try to move all clients to this fallback */
char *fallback_mount; char *fallback_mount;