Commit bded7d25 authored by Karl Heyes's avatar Karl Heyes

Small cleanups. Prevent possible segv in relay definition if missing server tag.

Don't add to stream directory until a minute has passed, it seems like a few sites
are triggering YP requests because they are connecting and then dropping (probably
due to timeout), so at least make sure the stream is running a little while.

svn path=/icecast/trunk/icecast/; revision=14777
parent 492da8a2
......@@ -31,6 +31,12 @@
<admin-password>hackme</admin-password>
</authentication>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
......@@ -117,12 +123,6 @@
<fileserve>1</fileserve>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>@pkgdatadir@</basedir>
......
......@@ -31,12 +31,14 @@ dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([alloca.h])
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics.
XIPH_C__FUNC__
dnl Check for types
......
......@@ -728,6 +728,7 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
relay->next = NULL;
relay->mp3metadata = 1;
relay->on_demand = configuration->on_demand;
relay->server = (char *)xmlCharStrdup ("127.0.0.1");
relay->mount = (char *)xmlCharStrdup ("/");
do {
......
......@@ -406,7 +406,6 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
/* force first touch in 5 secs */
yp->next_update = time(NULL) + 5;
}
return ret;
}
......@@ -480,7 +479,7 @@ static int do_yp_touch (ypdata_t *yp, char *s, unsigned len)
static int process_ypdata (struct yp_server *server, ypdata_t *yp)
{
unsigned len = 512;
unsigned len = 1024;
char *s = NULL, *tmp;
if (now < yp->next_update)
......@@ -501,7 +500,7 @@ static int process_ypdata (struct yp_server *server, ypdata_t *yp)
}
ret = yp->process (yp, s, len);
if (ret == 0)
if (ret <= 0)
{
free (s);
return ret;
......@@ -882,7 +881,7 @@ void yp_add (const char *mount)
yp->server = server;
yp->touch_interval = server->touch_interval;
yp->next = server->pending_mounts;
yp->next_update = time(NULL) + 5;
yp->next_update = time(NULL) + 60;
server->pending_mounts = yp;
yp_update = 1;
}
......
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