mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
Fix #1609
This commit is contained in:
@@ -100,8 +100,10 @@ function server.logout(username)
|
||||
local u = user_online[username]
|
||||
user_online[username] = nil
|
||||
if u.fd then
|
||||
gateserver.closeclient(u.fd)
|
||||
connection[u.fd] = nil
|
||||
if connection[u.fd] then
|
||||
gateserver.closeclient(u.fd)
|
||||
connection[u.fd] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -153,11 +155,15 @@ function server.start(conf)
|
||||
handshake[fd] = nil
|
||||
local c = connection[fd]
|
||||
if c then
|
||||
c.fd = nil
|
||||
connection[fd] = nil
|
||||
if conf.disconnect_handler then
|
||||
conf.disconnect_handler(c.username)
|
||||
end
|
||||
-- double check, conf.disconnect_handler may close fd
|
||||
if connection[fd] then
|
||||
c.fd = nil
|
||||
connection[fd] = nil
|
||||
gateserver.closeclient(fd)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user