From 711c04e6a94ce599fbb4afca55010c9621e694a9 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 3 Jul 2014 17:13:47 +0800 Subject: [PATCH] bugfix: redirect should pass session (0) --- examples/simplemonitor.lua | 2 +- lualib/skynet.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/simplemonitor.lua b/examples/simplemonitor.lua index 1528bb50..ec294d21 100644 --- a/examples/simplemonitor.lua +++ b/examples/simplemonitor.lua @@ -12,7 +12,7 @@ skynet.register_protocol { local w = service_map[address] if w then for watcher in pairs(w) do - skynet.redirect(watcher, address, "error", "") + skynet.redirect(watcher, address, "error", 0, "") end service_map[address] = false end diff --git a/lualib/skynet.lua b/lualib/skynet.lua index 2019f530..e2e274af 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -569,6 +569,7 @@ function skynet.monitor(service, query) end assert(monitor, "Monitor launch failed") c.command("MONITOR", string.format(":%08x", monitor)) + return monitor end function skynet.mqlen()