Commit fe2a763e authored by Karl Heyes's avatar Karl Heyes

make sure YP entries are flushed out when a source stops. Avoid

segv on failed icecast startup and add some log messages.

svn path=/icecast/trunk/icecast/; revision=6807
parent fcef29c6
......@@ -30,10 +30,10 @@
#include "cfgfile.h"
#include "stats.h"
#include <curl/curl.h>
#ifdef WIN32
#define snprintf _snprintf
#endif
#ifdef WIN32
#define snprintf _snprintf
#endif
#define CATMODULE "yp"
......@@ -314,12 +314,12 @@ static unsigned do_yp_remove (ypdata_t *yp, char *s, unsigned len)
INFO1 ("clearing up YP entry for %s", yp->mount);
send_to_yp ("remove", yp, s);
yp->remove = 1;
free (yp->sid);
yp->sid = NULL;
yp->process = do_yp_add;
yp_update = 1;
}
yp_update = 1;
yp->remove = 1;
yp->process = do_yp_add;
return 0;
}
......@@ -850,6 +850,7 @@ void yp_remove (const char *mount)
ypdata_t *yp = find_yp_mount (server, mount);
if (yp)
{
DEBUG2 ("mark %s on YP %s", mount, server->url);
yp->process = do_yp_remove;
yp->next_update = 0;
}
......@@ -888,7 +889,9 @@ void yp_shutdown ()
{
yp_running = 0;
yp_update = 1;
thread_join (yp_thread);
if (yp_thread)
thread_join (yp_thread);
curl_global_cleanup();
INFO0 ("YP thread down");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment