mirror of
https://github.com/lwch/natpass
synced 2025-10-16 09:50:37 +08:00
修正keepalive包的处理逻辑问题
This commit is contained in:
@@ -83,6 +83,9 @@ func (h *Handler) readHandshake(c *network.Conn) (string, error) {
|
||||
|
||||
// onMessage forward message
|
||||
func (h *Handler) onMessage(msg *network.Msg) {
|
||||
if msg.GetXType() == network.Msg_keepalive {
|
||||
return
|
||||
}
|
||||
to := msg.GetTo()
|
||||
h.RLock()
|
||||
cli := h.clients[to]
|
||||
@@ -91,10 +94,6 @@ func (h *Handler) onMessage(msg *network.Msg) {
|
||||
logging.Error("client %s not found", to)
|
||||
return
|
||||
}
|
||||
cli.updated = time.Now()
|
||||
if msg.GetXType() == network.Msg_keepalive {
|
||||
return
|
||||
}
|
||||
h.msgHook(msg)
|
||||
cli.writeMessage(msg)
|
||||
}
|
||||
|
Reference in New Issue
Block a user