1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-01-03 14:56:34 -05:00

add optional bind setting to relays

svn path=/icecast/trunk/icecast/; revision=15783
This commit is contained in:
Karl Heyes 2009-03-17 01:45:41 +00:00
parent d784622396
commit ed7e707f11
3 changed files with 6 additions and 1 deletions

View File

@ -775,6 +775,10 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node,
relay->on_demand = atoi(tmp); relay->on_demand = atoi(tmp);
if (tmp) xmlFree(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)); } while ((node = node->next));
if (relay->localmount == NULL) if (relay->localmount == NULL)
relay->localmount = (char *)xmlStrdup (XMLSTR(relay->mount)); relay->localmount = (char *)xmlStrdup (XMLSTR(relay->mount));

View File

@ -190,7 +190,7 @@ static client_t *open_relay_connection (relay_server *relay)
INFO2 ("connecting to %s:%d", server, port); 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) if (streamsock == SOCK_ERROR)
{ {
WARN2 ("Failed to connect to %s:%d", server, port); WARN2 ("Failed to connect to %s:%d", server, port);

View File

@ -22,6 +22,7 @@ typedef struct _relay_server {
char *username; char *username;
char *password; char *password;
char *localmount; char *localmount;
char *bind;
struct source_tag *source; struct source_tag *source;
int mp3metadata; int mp3metadata;
int on_demand; int on_demand;