1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

Fix: Corrected two possible dead-locks.

This commit is contained in:
Philipp Schafft 2018-09-20 13:03:05 +00:00
parent 1e171a8e4e
commit 7b84c45a81
2 changed files with 9 additions and 4 deletions

View File

@ -1341,6 +1341,7 @@ static void _handle_authed_client(client_t *client, void *userdata, auth_result
static void _handle_authentication_global(client_t *client, void *userdata, auth_result result)
{
ice_config_t *config;
auth_stack_t *authstack;
auth_stack_release(client->authstack);
client->authstack = NULL;
@ -1353,8 +1354,11 @@ static void _handle_authentication_global(client_t *client, void *userdata, auth
ICECAST_LOG_DEBUG("Trying global authenticators for client %p.", client);
config = config_get_config();
auth_stack_add_client(config->authstack, client, _handle_authed_client, userdata);
authstack = config->authstack;
auth_stack_addref(authstack);
config_release_config();
auth_stack_add_client(authstack, client, _handle_authed_client, userdata);
auth_stack_release(authstack);
}
static inline mount_proxy * __find_non_admin_mount(ice_config_t *config, const char *name, mount_type type)

View File

@ -843,6 +843,10 @@ static xmlNodePtr _dump_stats_to_doc (xmlNodePtr root, const char *show_mount, i
xmlNodePtr ret = NULL;
ice_config_t *config;
config = config_get_config();
__add_authstack(config->authstack, root);
config_release_config();
thread_mutex_lock(&_stats_mutex);
/* general stats first */
avlnode = avl_get_first(_stats.global_tree);
@ -855,9 +859,6 @@ static xmlNodePtr _dump_stats_to_doc (xmlNodePtr root, const char *show_mount, i
}
/* now per mount stats */
avlnode = avl_get_first(_stats.source_tree);
config = config_get_config();
__add_authstack(config->authstack, root);
config_release_config();
while (avlnode) {
stats_source_t *source = (stats_source_t *)avlnode->key;