Commit ed7e707f authored by Karl Heyes's avatar Karl Heyes

add optional bind setting to relays

svn path=/icecast/trunk/icecast/; revision=15783
parent d7846223
......@@ -775,6 +775,10 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
relay->on_demand = atoi(tmp);
if (tmp) xmlFree(tmp);
}
else if (xmlStrcmp (node->name, XMLSTR("bind")) == 0) {
if (relay->bind) xmlFree (relay->bind);
relay->bind = (char *)xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
}
} while ((node = node->next));
if (relay->localmount == NULL)
relay->localmount = (char *)xmlStrdup (XMLSTR(relay->mount));
......
......@@ -190,7 +190,7 @@ static client_t *open_relay_connection (relay_server *relay)
INFO2 ("connecting to %s:%d", server, port);
streamsock = sock_connect_wto (server, port, 10);
streamsock = sock_connect_wto_bind (server, port, relay->bind, 10);
if (streamsock == SOCK_ERROR)
{
WARN2 ("Failed to connect to %s:%d", server, port);
......
......@@ -22,6 +22,7 @@ typedef struct _relay_server {
char *username;
char *password;
char *localmount;
char *bind;
struct source_tag *source;
int mp3metadata;
int on_demand;
......
Markdown is supported
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