1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Sending <admin> field to yp server

This sends the <admin> field to yp servers. It is thought be useful
to allow reaching the admins more easily in case of any yp problem.

Closes: #2146
This commit is contained in:
Philipp Schafft 2015-01-18 18:47:24 +00:00
parent 319b6d577f
commit 9d84ba2036

View File

@ -389,6 +389,12 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
{
int ret;
char *value;
ice_config_t *config;
char *admin;
config = config_get_config();
admin = util_url_escape(config->admin);
config_release_config();
value = stats_get_value (yp->mount, "server_type");
add_yp_info (yp, value, YP_SERVER_TYPE);
@ -424,11 +430,14 @@ static int do_yp_add (ypdata_t *yp, char *s, unsigned len)
add_yp_info (yp, value, YP_AUDIO_INFO);
free (value);
ret = snprintf (s, len, "action=add&sn=%s&genre=%s&cpswd=%s&desc="
ret = snprintf (s, len, "action=add&admin=%s&sn=%s&genre=%s&cpswd=%s&desc="
"%s&url=%s&listenurl=%s&type=%s&stype=%s&b=%s&%s\r\n",
admin,
yp->server_name, yp->server_genre, yp->cluster_password,
yp->server_desc, yp->url, yp->listen_url,
yp->server_type, yp->subtype, yp->bitrate, yp->audio_info);
free(admin);
if (ret >= (signed)len)
return ret+1;
ret = send_to_yp ("add", yp, s);