1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Added support for usernames and passwords in master's mountlist

Closes: #2369
This commit is contained in:
Philipp Schafft 2020-10-22 15:58:19 +00:00
parent 4125ee6898
commit 76f7105e27

View File

@ -839,6 +839,16 @@ static int update_from_master(ice_config_t *config)
c->upstream_default.server = (char *)xmlCharStrdup(master);
c->upstream_default.port = port;
}
if (parsed_uri->user && strchr(parsed_uri->user, ':')) {
char *pw;
c->upstream_default.username = (char *)xmlCharStrdup(parsed_uri->user);
pw = strchr(c->upstream_default.username, ':');
if (pw) {
*(pw++) = 0;
c->upstream_default.password = (char *)xmlCharStrdup(pw);
}
}
c->upstream_default.mount = (char *)xmlCharStrdup(parsed_uri->path);
c->localmount = (char *)xmlCharStrdup(parsed_uri->path);