Commit d670683e authored by Karl Heyes's avatar Karl Heyes
Browse files

allow for the intro file to change over HUP

svn path=/icecast/trunk/icecast/; revision=10411
parent 11c6e103
...@@ -1091,7 +1091,12 @@ static void source_apply_mount (source_t *source, mount_proxy *mountinfo) ...@@ -1091,7 +1091,12 @@ static void source_apply_mount (source_t *source, mount_proxy *mountinfo)
else else
source->dumpfilename = NULL; source->dumpfilename = NULL;
if (mountinfo && mountinfo->intro_filename && source->intro_file == NULL) if (source->intro_file)
{
fclose (source->intro_file);
source->intro_file = NULL;
}
if (mountinfo && mountinfo->intro_filename)
{ {
ice_config_t *config = config_get_config_unlocked (); ice_config_t *config = config_get_config_unlocked ();
unsigned int len = strlen (config->webroot_dir) + unsigned int len = strlen (config->webroot_dir) +
...@@ -1099,11 +1104,14 @@ static void source_apply_mount (source_t *source, mount_proxy *mountinfo) ...@@ -1099,11 +1104,14 @@ static void source_apply_mount (source_t *source, mount_proxy *mountinfo)
char *path = malloc (len); char *path = malloc (len);
if (path) if (path)
{ {
FILE *f;
snprintf (path, len, "%s" PATH_SEPARATOR "%s", config->webroot_dir, snprintf (path, len, "%s" PATH_SEPARATOR "%s", config->webroot_dir,
mountinfo->intro_filename); mountinfo->intro_filename);
source->intro_file = fopen (path, "rb"); f = fopen (path, "rb");
if (source->intro_file == NULL) if (f)
source->intro_file = f;
else
WARN2 ("Cannot open intro file \"%s\": %s", path, strerror(errno)); WARN2 ("Cannot open intro file \"%s\": %s", path, strerror(errno));
free (path); free (path);
} }
......
Supports Markdown
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