bugfix: cast empty group

This commit is contained in:
云风
2012-10-22 21:56:01 +08:00
parent 022b034c6a
commit 0ff2cf604c
2 changed files with 5 additions and 1 deletions

View File

@@ -178,7 +178,9 @@ end
function skynet.cast(group, typename, ...)
local p = proto[typename]
return c.send(".cast", p.id, 0, mc(group, p.pack(...)))
if #group > 0 then
return c.send(".cast", p.id, 0, mc(group, p.pack(...)))
end
end
skynet.genid = assert(c.genid)

View File

@@ -216,6 +216,8 @@ void
skynet_multicast_cast(struct skynet_context * from, struct skynet_multicast_message *msg, const uint32_t *dests, int n) {
uint32_t source = skynet_context_handle(from);
skynet_multicast_copy(msg, n);
if (n == 0)
return;
int i;
int release = 0;
for (i=0;i<n;i++) {