删除无用forwarding数据 (#1565)

This commit is contained in:
coder
2022-04-02 19:30:46 +08:00
committed by GitHub
parent c84f7354ff
commit 969d3291b6

View File

@@ -3,7 +3,6 @@ local gateserver = require "snax.gateserver"
local watchdog
local connection = {} -- fd -> connection : { fd , client, agent , ip, mode }
local forwarding = {} -- agent -> connection
skynet.register_protocol {
name = "client",
@@ -41,7 +40,6 @@ end
local function unforward(c)
if c.agent then
forwarding[c.agent] = nil
c.agent = nil
c.client = nil
end
@@ -76,7 +74,6 @@ function CMD.forward(source, fd, client, address)
unforward(c)
c.client = client or 0
c.agent = address or source
forwarding[c.agent] = c
gateserver.openclient(fd)
end