Commit c66246b2 authored by Karl Heyes's avatar Karl Heyes

fix for race, client needs setup before adding to pending tree

svn path=/icecast/trunk/icecast/; revision=10019
parent c1692662
......@@ -295,17 +295,18 @@ static int add_client_to_source (source_t *source, client_t *client)
return -1;
} while (1);
/* lets add the client to the active list */
avl_tree_wlock (source->pending_tree);
avl_insert (source->pending_tree, client);
avl_tree_unlock (source->pending_tree);
stats_event_inc (NULL, "listener_connections");
client->write_to_client = format_generic_write_to_client;
client->check_buffer = format_check_http_buffer;
client->refbuf->len = PER_CLIENT_REFBUF_SIZE;
memset (client->refbuf->data, 0, PER_CLIENT_REFBUF_SIZE);
/* lets add the client to the active list */
avl_tree_wlock (source->pending_tree);
avl_insert (source->pending_tree, client);
avl_tree_unlock (source->pending_tree);
stats_event_inc (NULL, "listener_connections");
if (source->running == 0 && source->on_demand)
{
/* enable on-demand relay to start, wake up the slave thread */
......
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