[Icecast-dev] dump-file per source per mount

Jaakko Manninen kschzt at gmail.com
Mon Oct 24 18:21:16 PDT 2005


Hi Guillaume,

I'm using dump-file and it works wonderfully, what I need is a way to add
the source IP
(for example, or other identifier) to the dump file name so that I can keep
each source in
separate dumps. This is useful for redistributing each set separately later,
without
having to decode, cut and re-encode the dump-file.

Here's the quick hack to just always do this.

--- icecast-2.3.0/src/source.c 2005-09-22 23:19:28.000000000 +0300
+++ icecast-2.3.0/src/source.c 2005-10-25 04:18:22.000000000 +0300
@@ -591,11 +591,14 @@

if (source->dumpfilename != NULL)
{
- source->dumpfile = fopen (source->dumpfilename, "ab");
+ char dumpfile[strlen(source->dumpfilename) + 32];
+ sprintf(dumpfile, "%s.%s", source->dumpfilename, source->client->con->ip);
+
+ source->dumpfile = fopen (dumpfile, "ab");
if (source->dumpfile == NULL)
{
WARN2("Cannot open dump file \"%s\" for appending: %s, disabling.",
- source->dumpfilename, strerror(errno));
+ dumpfile, strerror(errno));
}
}


Of course, the source IP may change.. But it seems to be the only usable
identifier.

PS you shouldn't keep dump-file in /tmp.

Regards,
Jaakko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20051025/8858d497/attachment.html


More information about the Icecast-dev mailing list