1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

add per-mount listener time limit setting

svn path=/icecast/trunk/icecast/; revision=9834
This commit is contained in:
Karl Heyes 2005-08-23 19:00:15 +00:00
parent 82e12b4d96
commit c519afa812
4 changed files with 16 additions and 0 deletions

View File

@ -365,6 +365,7 @@ If you are relaying a Shoutcast stream, you need to specify this indicator to al
<username>othersource</username>
<password>hackmemore</password>
<max-listeners>1</max-listeners>
<max-listener-duration>3600</max-listener-duration>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<intro>/intro.ogg</intro>
<fallback-mount>/example2.ogg</fallback-mount>
@ -416,6 +417,11 @@ An optional value which will set the password that a source must use to connect
<div class="indentedbox">
An optional value which will set the maximum number of listeners that can be attached to this mountpoint.
</div>
<h4>max-listener-duration</h4>
<div class="indentedbox">
An optional value which will set the length of time a listener will stay connected to the
stream. An auth component may override this.
</div>
<h4>dump-file</h4>
<div class="indentedbox">
An optional value which will set the filename which will be a dump of the stream coming through on this mountpoint.

View File

@ -322,6 +322,10 @@ static int add_authenticated_client (const char *mount, mount_proxy *mountinfo,
avl_tree_unlock (global.source_tree);
return -1;
}
/* set a per-mount disconnect time if auth hasn't set one already */
if (mountinfo->max_listener_duration && client->con->discon_time == 0)
client->con->discon_time = time(NULL) + mountinfo->max_listener_duration;
ret = add_client_to_source (source, client);
avl_tree_unlock (global.source_tree);
if (ret == 0)

View File

@ -615,6 +615,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
mount->on_disconnect = (char *)xmlNodeListGetString(
doc, node->xmlChildrenNode, 1);
}
else if (strcmp(node->name, "max-listener-duration") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->max_listener_duration = atoi(tmp);
if(tmp) xmlFree(tmp);
}
else if (strcmp(node->name, "queue-size") == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
mount->queue_size_limit = atoi (tmp);

View File

@ -72,6 +72,7 @@ typedef struct _mount_proxy {
config_options_t *auth_options; /* Options for this type */
char *on_connect;
char *on_disconnect;
unsigned int max_listener_duration;
char *stream_name;
char *stream_description;