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

extra checks on YP updating, typically on changes over HUP

svn path=/icecast/trunk/icecast/; revision=9862
This commit is contained in:
Karl Heyes 2005-08-30 00:30:30 +00:00
parent 1d5c1ebdd6
commit 3116f62a9d

View File

@ -601,7 +601,7 @@ static void check_servers ()
ypdata_t *yp; ypdata_t *yp;
source_t *source = node->key; source_t *source = node->key;
if ((yp = create_yp_entry (source->mount)) != NULL) if (source->yp_public && (yp = create_yp_entry (source->mount)) != NULL)
{ {
DEBUG1 ("Adding existing mount %s", source->mount); DEBUG1 ("Adding existing mount %s", source->mount);
yp->server = server; yp->server = server;
@ -830,8 +830,14 @@ void yp_add (const char *mount)
while (server) while (server)
{ {
ypdata_t *yp; ypdata_t *yp;
/* on-demand relays may already have a YP entry */
yp = find_yp_mount (server->mounts, mount);
if (yp == NULL)
{
/* add new ypdata to each servers pending yp */ /* add new ypdata to each servers pending yp */
if ((yp = create_yp_entry (mount)) != NULL) yp = create_yp_entry (mount);
if (yp)
{ {
DEBUG2 ("Adding %s to %s", mount, server->url); DEBUG2 ("Adding %s to %s", mount, server->url);
yp->server = server; yp->server = server;
@ -841,6 +847,9 @@ void yp_add (const char *mount)
server->pending_mounts = yp; server->pending_mounts = yp;
yp_update = 1; yp_update = 1;
} }
}
else
DEBUG1 ("YP entry %s already exists", mount);
server = server->next; server = server->next;
} }
thread_mutex_unlock (&yp_pending_lock); thread_mutex_unlock (&yp_pending_lock);