1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

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

svn path=/icecast/trunk/icecast/; revision=10019
This commit is contained in:
Karl Heyes 2005-09-16 16:53:33 +00:00
parent c16926625f
commit c66246b255

View File

@ -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 */