...
 
......@@ -459,6 +459,8 @@ static client_queue_t *create_client_node(client_t *client)
node->shoutcast_mount = strdup(listener->shoutcast_mount);
}
listensocket_release_listener(client->con->listensocket_effective);
return node;
}
......@@ -1016,6 +1018,7 @@ static int _handle_aliases(client_t *client, char **uri)
alias = alias->next;
}
listensocket_release_listener(client->con->listensocket_effective);
config_release_config();
if (new_uri) {
......@@ -1171,15 +1174,18 @@ static void __prepare_shoutcast_admin_cgi_request(client_t *client)
return;
}
listener = listensocket_get_listener(client->con->listensocket_effective);
/* Why do we acquire a global lock here? -- ph3-der-loewe, 2018-05-11 */
global_lock();
config = config_get_config();
sc_mount = config->shoutcast_mount;
listener = listensocket_get_listener(client->con->listensocket_effective);
if (listener && listener->shoutcast_mount)
sc_mount = listener->shoutcast_mount;
httpp_set_query_param(client->parser, "mount", sc_mount);
listensocket_release_listener(client->con->listensocket_effective);
httpp_setvar(client->parser, HTTPP_VAR_PROTOCOL, "ICY");
client->password = strdup(pass);
config_release_config();
......
This diff is collapsed.
......@@ -31,5 +31,6 @@ int listensocket_refsock(listensocket_t *self);
int listensocket_unrefsock(listensocket_t *self);
connection_t * listensocket_accept(listensocket_t *self);
const listener_t * listensocket_get_listener(listensocket_t *self);
int listensocket_release_listener(listensocket_t *self);
#endif