mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-22 04:15:54 -04:00
Update: Added language, and sourceinstance parameter to yp add
This commit is contained in:
parent
71f8061a57
commit
6190256227
27
src/yp.c
27
src/yp.c
@ -379,11 +379,24 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
|
|||||||
char *value;
|
char *value;
|
||||||
ice_config_t *config;
|
ice_config_t *config;
|
||||||
char *admin;
|
char *admin;
|
||||||
|
char *content_language;
|
||||||
|
char *instance_uuid;
|
||||||
|
|
||||||
config = config_get_config();
|
config = config_get_config();
|
||||||
admin = util_url_escape(config->admin);
|
admin = util_url_escape(config->admin);
|
||||||
config_release_config();
|
config_release_config();
|
||||||
|
|
||||||
|
{
|
||||||
|
avl_tree_rlock(global.source_tree);
|
||||||
|
source_t *source = source_find_mount(yp->mount);
|
||||||
|
instance_uuid = util_url_escape(source->instance_uuid);
|
||||||
|
avl_tree_unlock(global.source_tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
value = stats_get_value(yp->mount, "content-language");
|
||||||
|
content_language = value ? util_url_escape(value) : NULL;
|
||||||
|
free(value);
|
||||||
|
|
||||||
value = stats_get_value(yp->mount, "server_type");
|
value = stats_get_value(yp->mount, "server_type");
|
||||||
add_yp_info(yp, value, YP_SERVER_TYPE);
|
add_yp_info(yp, value, YP_SERVER_TYPE);
|
||||||
free(value);
|
free(value);
|
||||||
@ -416,13 +429,19 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
|
|||||||
|
|
||||||
update_yp_info(yp);
|
update_yp_info(yp);
|
||||||
|
|
||||||
ret = snprintf(s, len, "action=add&admin=%s&sn=%s&genre=%s&cpswd=%s&desc="
|
ret = snprintf(s, len, "action=add&admin=%s&sn=%s&genre=%s&cpswd=%s"
|
||||||
"%s&url=%s&listenurl=%s&type=%s&stype=%s&b=%s&samplerate=%s&channels=%s&audioinfo=%s",
|
"&desc=%s&url=%s&listenurl=%s&type=%s&stype=%s"
|
||||||
|
"&language=%s&sourceinstance=%s"
|
||||||
|
"&b=%s&samplerate=%s&channels=%s&audioinfo=%s",
|
||||||
admin,
|
admin,
|
||||||
yp->server_name, yp->server_genre, yp->cluster_password,
|
yp->server_name, yp->server_genre, yp->cluster_password,
|
||||||
yp->server_desc, yp->url, yp->listen_url,
|
yp->server_desc, yp->url, yp->listen_url,
|
||||||
yp->server_type, yp->subtype, yp->bitrate,
|
yp->server_type, yp->subtype,
|
||||||
yp->audio_samplerate, yp->audio_channels, yp->audio_info);
|
content_language ? content_language : "", instance_uuid,
|
||||||
|
yp->bitrate, yp->audio_samplerate, yp->audio_channels,
|
||||||
|
yp->audio_info);
|
||||||
|
free(instance_uuid);
|
||||||
|
free(content_language);
|
||||||
free(admin);
|
free(admin);
|
||||||
|
|
||||||
if (ret >= (signed)len)
|
if (ret >= (signed)len)
|
||||||
|
Loading…
Reference in New Issue
Block a user