Commit 7b84c45a authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Corrected two possible dead-locks.

parent 1e171a8e
......@@ -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)
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment