mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
删除无用forwarding数据 (#1565)
This commit is contained in:
@@ -3,7 +3,6 @@ local gateserver = require "snax.gateserver"
|
|||||||
|
|
||||||
local watchdog
|
local watchdog
|
||||||
local connection = {} -- fd -> connection : { fd , client, agent , ip, mode }
|
local connection = {} -- fd -> connection : { fd , client, agent , ip, mode }
|
||||||
local forwarding = {} -- agent -> connection
|
|
||||||
|
|
||||||
skynet.register_protocol {
|
skynet.register_protocol {
|
||||||
name = "client",
|
name = "client",
|
||||||
@@ -41,7 +40,6 @@ end
|
|||||||
|
|
||||||
local function unforward(c)
|
local function unforward(c)
|
||||||
if c.agent then
|
if c.agent then
|
||||||
forwarding[c.agent] = nil
|
|
||||||
c.agent = nil
|
c.agent = nil
|
||||||
c.client = nil
|
c.client = nil
|
||||||
end
|
end
|
||||||
@@ -76,7 +74,6 @@ function CMD.forward(source, fd, client, address)
|
|||||||
unforward(c)
|
unforward(c)
|
||||||
c.client = client or 0
|
c.client = client or 0
|
||||||
c.agent = address or source
|
c.agent = address or source
|
||||||
forwarding[c.agent] = c
|
|
||||||
gateserver.openclient(fd)
|
gateserver.openclient(fd)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user