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

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
This commit is contained in:
Karl Heyes 2008-04-19 02:04:17 +00:00
parent 492da8a239
commit bded7d2564
4 changed files with 12 additions and 10 deletions

View File

@ -31,6 +31,12 @@
<admin-password>hackme</admin-password> <admin-password>hackme</admin-password>
</authentication> </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 --> <!-- Uncomment this if you want directory listings -->
<!-- <!--
<directory> <directory>
@ -117,12 +123,6 @@
<fileserve>1</fileserve> <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> <paths>
<!-- basedir is only used if chroot is enabled --> <!-- basedir is only used if chroot is enabled -->
<basedir>@pkgdatadir@</basedir> <basedir>@pkgdatadir@</basedir>

View File

@ -31,12 +31,14 @@ dnl Checks for libraries.
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([alloca.h]) AC_CHECK_HEADERS([alloca.h])
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.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]),,) AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
XIPH_C__FUNC__
dnl Check for types dnl Check for types

View File

@ -728,6 +728,7 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
relay->next = NULL; relay->next = NULL;
relay->mp3metadata = 1; relay->mp3metadata = 1;
relay->on_demand = configuration->on_demand; relay->on_demand = configuration->on_demand;
relay->server = (char *)xmlCharStrdup ("127.0.0.1");
relay->mount = (char *)xmlCharStrdup ("/"); relay->mount = (char *)xmlCharStrdup ("/");
do { do {

View File

@ -406,7 +406,6 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
/* force first touch in 5 secs */ /* force first touch in 5 secs */
yp->next_update = time(NULL) + 5; yp->next_update = time(NULL) + 5;
} }
return ret; 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) static int process_ypdata (struct yp_server *server, ypdata_t *yp)
{ {
unsigned len = 512; unsigned len = 1024;
char *s = NULL, *tmp; char *s = NULL, *tmp;
if (now < yp->next_update) 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); ret = yp->process (yp, s, len);
if (ret == 0) if (ret <= 0)
{ {
free (s); free (s);
return ret; return ret;
@ -882,7 +881,7 @@ void yp_add (const char *mount)
yp->server = server; yp->server = server;
yp->touch_interval = server->touch_interval; yp->touch_interval = server->touch_interval;
yp->next = server->pending_mounts; yp->next = server->pending_mounts;
yp->next_update = time(NULL) + 5; yp->next_update = time(NULL) + 60;
server->pending_mounts = yp; server->pending_mounts = yp;
yp_update = 1; yp_update = 1;
} }