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

Fix: YP: Send correct listener URL in case of TLS

This commit is contained in:
Marvin Scholz 2020-04-21 20:12:22 +02:00
parent 2b56f73cfb
commit 7563fe9e52

View File

@ -572,7 +572,7 @@ static ypdata_t *create_yp_entry (const char *mount)
do
{
unsigned len = 512;
int ret;
ssize_t ret;
char *url;
mount_proxy *mountproxy = NULL;
ice_config_t *config;
@ -595,15 +595,16 @@ static ypdata_t *create_yp_entry (const char *mount)
url = malloc (len);
if (url == NULL)
break;
config = config_get_config();
ret = snprintf (url, len, "http://%s:%d%s", config->hostname, config->port, mount);
if (ret >= (signed)len)
{
s = realloc (url, ++ret);
ret = client_get_baseurl(NULL, NULL, url, len, NULL, NULL, NULL, mount, NULL);
if (ret >= len) {
// Buffer was too small, allocate a big enough one
s = realloc (url, ret + 1);
if (s) url = s;
snprintf (url, ret, "http://%s:%d%s", config->hostname, config->port, mount);
client_get_baseurl(NULL, NULL, url, len, NULL, NULL, NULL, mount, NULL);
}
config = config_get_config();
mountproxy = config_find_mount (config, mount, MOUNT_TYPE_NORMAL);
if (mountproxy && mountproxy->cluster_password)
add_yp_info (yp, mountproxy->cluster_password, YP_CLUSTER_PASSWORD);