From 9033c5cdd96ad64c345191fd653a75248b6dc2e7 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 30 Apr 2014 17:34:14 +0800 Subject: [PATCH] bugfix: double check in SUB --- service/multicastd.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service/multicastd.lua b/service/multicastd.lua index d82c10fe..66e4f1c4 100644 --- a/service/multicastd.lua +++ b/service/multicastd.lua @@ -137,8 +137,11 @@ function command.SUB(source, c) if skynet.call(node_address[node], "lua", "SUBR", c) then return end - channel[c] = {} - channel_n[c] = 0 + if channel[c] == nil then + -- double check, because skynet.call whould yield, other SUB may occur. + channel[c] = {} + channel_n[c] = 0 + end end end local group = channel[c]