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

fic listen

This commit is contained in:
fumiama
2021-12-28 22:37:39 +08:00
parent d751ce41a2
commit e6bbe5a9b2

View File

@@ -32,12 +32,12 @@ func (m *Me) listen() (conn *net.UDPConn, err error) {
p, ok := m.IsInPeer(packet.Src)
logrus.Infoln("[link] recv from endpoint", addr, "src", packet.Src, "dst", packet.Dst)
logrus.Debugln("[link] recv:", string(lbf))
if p.pep == "" || p.pep != addr.String() {
logrus.Infoln("[link] set endpoint of peer", p.peerip, "to", addr.String())
p.endpoint = addr
p.pep = addr.String()
}
if ok {
if p.pep == "" || p.pep != addr.String() {
logrus.Infoln("[link] set endpoint of peer", p.peerip, "to", addr.String())
p.endpoint = addr
p.pep = addr.String()
}
if p.IsToMe(net.ParseIP(packet.Dst)) {
packet.Data = p.Decode(packet.Data)
if packet.IsVaildHash() {