mirror of
https://github.com/lwch/natpass
synced 2025-10-06 13:57:16 +08:00
增加server端的from字段改写逻辑
This commit is contained in:
@@ -170,13 +170,18 @@ func (h *Handler) msgHook(msg *network.Msg, from, to *client) {
|
||||
h.links[id] = pair
|
||||
h.Unlock()
|
||||
case network.Msg_disconnect:
|
||||
id := msg.GetXDisconnect().GetId()
|
||||
if from != nil {
|
||||
from.removeLink(msg.GetXDisconnect().GetId())
|
||||
from.removeLink(id)
|
||||
}
|
||||
if to != nil {
|
||||
to.removeLink(msg.GetXDisconnect().GetId())
|
||||
to.removeLink(id)
|
||||
}
|
||||
h.Lock()
|
||||
delete(h.links, id)
|
||||
h.Unlock()
|
||||
}
|
||||
msg.From = from.trimID
|
||||
}
|
||||
|
||||
// closeAll close all links from client
|
||||
|
Reference in New Issue
Block a user