[xiph-commits] r9274 - in icecast/trunk/icecast: doc src
karl at motherfish-iii.xiph.org
karl at motherfish-iii.xiph.org
Thu May 12 17:35:12 PDT 2005
Author: karl
Date: 2005-05-12 17:35:08 -0700 (Thu, 12 May 2005)
New Revision: 9274
Modified:
icecast/trunk/icecast/doc/icecast2_config_file.html
icecast/trunk/icecast/src/cfgfile.c
icecast/trunk/icecast/src/cfgfile.h
icecast/trunk/icecast/src/connection.c
icecast/trunk/icecast/src/slave.c
Log:
Allow for username to be stated for master/slave setups, we still default
to 'relay' though
Modified: icecast/trunk/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/trunk/icecast/doc/icecast2_config_file.html 2005-05-12 06:11:46 UTC (rev 9273)
+++ icecast/trunk/icecast/doc/icecast2_config_file.html 2005-05-13 00:35:08 UTC (rev 9274)
@@ -95,6 +95,7 @@
<pre>
<authentication>
<source-password>hackme</source-password>
+ <relay-user>relay</relay-user>
<relay-password>hackme</relay-password>
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
@@ -106,9 +107,15 @@
<div class="indentedbox">
The unencrypted password used by sources to connect to icecast2. Currently, the username for all source connections must be 'source'. This is likely to change in the future.
</div>
+<h4>relay-user</h4>
+<div class="indentedbox">
+Used in the master server as part of the authentication when a slave requests
+the list of streams to relay. The default username is 'relay'
+</div>
<h4>relay-password</h4>
<div class="indentedbox">
-Currently not used.
+Used in the master server as part of the authentication when a slave requests
+the list of streams to relay.
</div>
<h4>admin-user</h4>
<h4>admin-password</h4>
@@ -201,6 +208,7 @@
<master-server>127.0.0.1</master-server>
<master-server-port>8001</master-server-port>
<master-update-interval>120</master-update-interval>
+ <master-username>relay</master-username>
<master-password>hackme</master-password>
<relay>
@@ -249,9 +257,16 @@
<div class="indentedbox">
The interval (in seconds) that the Relay Server will poll the Master Server for any new mountpoints to relay.
</div>
+<h4>master-username</h4>
+<div class="indentedbox">
+This is the relay username on the master server. It is used to query the
+server for a list of mountpoints to relay. If not specified then 'relay' is
+used
+</div>
<h4>master-password</h4>
<div class="indentedbox">
-This is the admin password on the Master server. It is used to query the server for a list of mountpoints to relay.
+This is the relay password on the Master server. It is used to query the
+server for a list of mountpoints to relay.
</div>
<br />
<h3>Specific Mountpoint Relay</h3>
Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c 2005-05-12 06:11:46 UTC (rev 9273)
+++ icecast/trunk/icecast/src/cfgfile.c 2005-05-13 00:35:08 UTC (rev 9274)
@@ -38,6 +38,7 @@
#define CONFIG_DEFAULT_SOURCE_TIMEOUT 10
#define CONFIG_DEFAULT_SOURCE_PASSWORD "changeme"
#define CONFIG_DEFAULT_RELAY_PASSWORD "changeme"
+#define CONFIG_DEFAULT_MASTER_USERNAME "relay"
#define CONFIG_DEFAULT_SHOUTCAST_MOUNT "/stream"
#define CONFIG_DEFAULT_ICE_LOGIN 0
#define CONFIG_DEFAULT_FILESERVE 1
@@ -163,6 +164,7 @@
if (c->listeners[i].bind_address) xmlFree(c->listeners[i].bind_address);
}
if (c->master_server) xmlFree(c->master_server);
+ if (c->master_username) xmlFree(c->master_username);
if (c->master_password) xmlFree(c->master_password);
if (c->user) xmlFree(c->user);
if (c->group) xmlFree(c->group);
@@ -341,6 +343,7 @@
configuration->master_server = NULL;
configuration->master_server_port = 0;
configuration->master_update_interval = CONFIG_MASTER_UPDATE_INTERVAL;
+ configuration->master_username = xmlStrdup (CONFIG_DEFAULT_MASTER_USERNAME);
configuration->master_password = NULL;
configuration->base_dir = CONFIG_DEFAULT_BASE_DIR;
configuration->log_dir = CONFIG_DEFAULT_LOG_DIR;
@@ -355,7 +358,7 @@
configuration->user = CONFIG_DEFAULT_USER;
configuration->group = CONFIG_DEFAULT_GROUP;
configuration->num_yp_directories = 0;
- configuration->relay_username = NULL;
+ configuration->relay_username = xmlStrdup (CONFIG_DEFAULT_MASTER_USERNAME);
configuration->relay_password = NULL;
/* default to a typical prebuffer size used by clients */
configuration->burst_size = 65536;
@@ -414,6 +417,9 @@
} else if (strcmp(node->name, "master-server") == 0) {
if (configuration->master_server) xmlFree(configuration->master_server);
configuration->master_server = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+ } else if (strcmp(node->name, "master-username") == 0) {
+ if (configuration->master_username) xmlFree(configuration->master_username);
+ configuration->master_username = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (strcmp(node->name, "master-password") == 0) {
if (configuration->master_password) xmlFree(configuration->master_password);
configuration->master_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
Modified: icecast/trunk/icecast/src/cfgfile.h
===================================================================
--- icecast/trunk/icecast/src/cfgfile.h 2005-05-12 06:11:46 UTC (rev 9273)
+++ icecast/trunk/icecast/src/cfgfile.h 2005-05-13 00:35:08 UTC (rev 9274)
@@ -118,6 +118,7 @@
char *master_server;
int master_server_port;
int master_update_interval;
+ char *master_username;
char *master_password;
relay_server *relay;
Modified: icecast/trunk/icecast/src/connection.c
===================================================================
--- icecast/trunk/icecast/src/connection.c 2005-05-12 06:11:46 UTC (rev 9273)
+++ icecast/trunk/icecast/src/connection.c 2005-05-13 00:35:08 UTC (rev 9274)
@@ -634,7 +634,7 @@
int ret;
ice_config_t *config = config_get_config();
char *pass = config->relay_password;
- char *user = "relay";
+ char *user = config->relay_username;
if(!pass || !user) {
config_release_config();
Modified: icecast/trunk/icecast/src/slave.c
===================================================================
--- icecast/trunk/icecast/src/slave.c 2005-05-12 06:11:46 UTC (rev 9273)
+++ icecast/trunk/icecast/src/slave.c 2005-05-13 00:35:08 UTC (rev 9274)
@@ -409,7 +409,7 @@
relay_server *new_relays = NULL, *cleanup_relays;
int len, count = 1;
- username = strdup ("relay");
+ username = strdup (config->master_username);
if (config->master_password)
password = strdup (config->master_password);
More information about the commits
mailing list