diff options
-rw-r--r-- | agent/tcf/services/streamsservice.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/agent/tcf/services/streamsservice.c b/agent/tcf/services/streamsservice.c index 12869b0c..125e6a4a 100644 --- a/agent/tcf/services/streamsservice.c +++ b/agent/tcf/services/streamsservice.c @@ -927,13 +927,16 @@ static void channel_close_listener(Channel * c) { void ini_streams_service(Protocol * proto) { int i; + static int ini_streams = 0; - for (i = 0; i < HANDLE_HASH_SIZE; i++) { - list_init(&handle_hash[i]); + if (ini_streams == 0) { + for (i = 0; i < HANDLE_HASH_SIZE; i++) { + list_init(&handle_hash[i]); + } + add_channel_close_listener(channel_close_listener); + ini_streams = 1; } - add_channel_close_listener(channel_close_listener); - add_command_handler(proto, STREAMS, "subscribe", command_subscribe); add_command_handler(proto, STREAMS, "unsubscribe", command_unsubscribe); add_command_handler(proto, STREAMS, "read", command_read); |