bugfix: master, don't report offline slave

This commit is contained in:
Cloud Wu
2014-06-24 11:33:29 +08:00
parent d8b0e977f3
commit cc2cffacb7

View File

@@ -47,8 +47,10 @@ local function report_slave(fd, slave_id, slave_addr)
local message = pack_package("C", slave_id, slave_addr)
local n = 0
for k,v in pairs(slave_node) do
socket.write(v.fd, message)
n = n + 1
if v.fd ~= 0 then
socket.write(v.fd, message)
n = n + 1
end
end
socket.write(fd, pack_package("W", n))
end