1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

fix(listen): ep logging

This commit is contained in:
源文雨
2025-02-21 15:16:44 +09:00
parent 409f0f270b
commit 956199cf19

View File

@@ -166,10 +166,10 @@ func (m *Me) dispatch(packet *head.Packet, addr p2p.EndPoint, index int, finish
return
}
if p.endpoint == nil || !p.endpoint.Euqal(addr) {
if m.ep.Network() == "udp" {
if m.ep.Network() == "tcp" && !addr.Euqal(p.endpoint) {
logrus.Infoln("[listen] @", index, "set endpoint of peer", p.peerip, "to", addr.String())
p.endpoint = addr
} else if !addr.Euqal(p.endpoint) && p.rawep == "" { // tcp/ws, ep not registered
} else { // others are all no status link
logrus.Infoln("[listen] @", index, "set endpoint of peer", p.peerip, "to", addr.String())
p.endpoint = addr
}