From 208be03a6facb368892f7b0a85a2ae2850db692c Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Fri, 10 Dec 2021 20:48:51 +0800 Subject: [PATCH] Disconnected during auth, See #1513 --- lualib/skynet/socketchannel.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lualib/skynet/socketchannel.lua b/lualib/skynet/socketchannel.lua index 521d9832..3054de43 100644 --- a/lualib/skynet/socketchannel.lua +++ b/lualib/skynet/socketchannel.lua @@ -388,13 +388,17 @@ end local function check_connection(self) if self.__sock then + local authco = self.__authcoroutine if socket.disconnected(self.__sock[1]) then -- closed by peer skynet.error("socket: disconnect detected ", self.__host, self.__port) close_channel_socket(self) + if authco and authco == coroutine.running() then + -- disconnected during auth, See #1513 + return false + end return end - local authco = self.__authcoroutine if not authco then return true end