[xiph-commits] r7298 - in icecast/branches/kh/icecast: conf src

karl at dactyl.lonelymoon.com karl
Fri Jul 23 17:56:08 PDT 2004


Author: karl
Date: Fri Jul 23 17:56:08 2004
New Revision: 7298

Modified:
icecast/branches/kh/icecast/conf/icecast.xml.in
icecast/branches/kh/icecast/src/cfgfile.c
icecast/branches/kh/icecast/src/cfgfile.h
icecast/branches/kh/icecast/src/connection.c
icecast/branches/kh/icecast/src/slave.c
icecast/branches/kh/icecast/src/source.c
Log:
allow for all relays to default to on-demand, and update per-client write limits


Modified: icecast/branches/kh/icecast/conf/icecast.xml.in
===================================================================
--- icecast/branches/kh/icecast/conf/icecast.xml.in	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/conf/icecast.xml.in	2004-07-24 00:56:05 UTC (rev 7298)
@@ -51,6 +51,7 @@
</listen-socket>
-->

+    <!--<relays-on-demand>1</relays-on-demand>-->
<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->

Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2004-07-24 00:56:05 UTC (rev 7298)
@@ -321,6 +321,7 @@
configuration->ice_login = CONFIG_DEFAULT_ICE_LOGIN;
configuration->fileserve = CONFIG_DEFAULT_FILESERVE;
configuration->touch_interval = CONFIG_DEFAULT_TOUCH_FREQ;
+    configuration->on_demand = 0;
configuration->dir_list = NULL;
configuration->hostname = CONFIG_DEFAULT_HOSTNAME;
configuration->port = 0;
@@ -383,6 +384,10 @@
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->fileserve = atoi(tmp);
if (tmp) xmlFree(tmp);
+        } else if (strcmp(node->name, "relays-on-demand") == 0) {
+            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+            configuration->on_demand = atoi(tmp);
+            if (tmp) xmlFree(tmp);
} else if (strcmp(node->name, "hostname") == 0) {
if (configuration->hostname && configuration->hostname != CONFIG_DEFAULT_HOSTNAME) xmlFree(configuration->hostname);
configuration->hostname = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
@@ -632,6 +637,7 @@

relay->next = NULL;
relay->mp3metadata = 1;
+    relay->on_demand = configuration->on_demand;

do {
if (node == NULL) break;

Modified: icecast/branches/kh/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.h	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/src/cfgfile.h	2004-07-24 00:56:05 UTC (rev 7298)
@@ -99,6 +99,7 @@
int source_timeout;
int ice_login;
int fileserve;
+    int on_demand; /* global setting for all relays */

char *source_password;
char *admin_username;

Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/src/connection.c	2004-07-24 00:56:05 UTC (rev 7298)
@@ -474,7 +474,7 @@
/* set global settings first */
source->queue_size_limit = config->queue_size_limit;
source->timeout = config->source_timeout;
-        // source->burst_size = config->burst_size_limit;
+        source->on_demand = config->on_demand;
source->burst_size_limit = config->burst_size_limit;

/* for relays, we don't yet have a client, however we do require one

Modified: icecast/branches/kh/icecast/src/slave.c
===================================================================
--- icecast/branches/kh/icecast/src/slave.c	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/src/slave.c	2004-07-24 00:56:05 UTC (rev 7298)
@@ -358,6 +358,7 @@
char *authheader, *data;
relay_server *relays = NULL, *relay;
int len, count = 1;
+        int on_demand;

if (config->master_username)
username = strdup (config->master_password);
@@ -373,6 +374,7 @@

if (password == NULL || master == NULL || port == 0)
break;
+        on_demand = config->on_demand;
ret = 1;
config_release_config();
mastersock = sock_connect_wto (master, port, 0);
@@ -415,6 +417,7 @@
r->mount = xmlStrdup (buf);
r->localmount = xmlStrdup (buf);
r->mp3metadata = 1;
+                r->on_demand = on_demand;
r->next = relays;
relays = r;
}

Modified: icecast/branches/kh/icecast/src/source.c
===================================================================
--- icecast/branches/kh/icecast/src/source.c	2004-07-23 23:13:08 UTC (rev 7297)
+++ icecast/branches/kh/icecast/src/source.c	2004-07-24 00:56:05 UTC (rev 7298)
@@ -441,7 +441,7 @@
static int send_to_listener (source_t *source, client_t *client, int deletion_expected)
{
int bytes;
-    int loop = 10;   /* max number of iterations in one go */
+    int loop = 20;   /* max number of iterations in one go */
int total_written = 0;
int ret = 1;

@@ -472,7 +472,7 @@

/* lets not send too much to one client in one go, but don't
sleep for too long if more data can be sent */
-        if (total_written > 15000 || loop == 0)
+        if (total_written > 25000 || loop == 0)
break;

loop--;



More information about the commits mailing list