mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-12 12:50:28 +08:00
fix(p2p): wrong issub init
This commit is contained in:
@@ -182,8 +182,6 @@ func (conn *Conn) receive(tcpconn *net.TCPConn, hasvalidated bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if issub {
|
if issub {
|
||||||
defer conn.peers.Delete(ep.String())
|
|
||||||
} else {
|
|
||||||
defer func() {
|
defer func() {
|
||||||
conn.sblk.Lock()
|
conn.sblk.Lock()
|
||||||
for i, sub := range conn.subs {
|
for i, sub := range conn.subs {
|
||||||
@@ -194,6 +192,8 @@ func (conn *Conn) receive(tcpconn *net.TCPConn, hasvalidated bool) {
|
|||||||
}
|
}
|
||||||
conn.sblk.Unlock()
|
conn.sblk.Unlock()
|
||||||
}()
|
}()
|
||||||
|
} else {
|
||||||
|
defer conn.peers.Delete(ep.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
go conn.keep(ep)
|
go conn.keep(ep)
|
||||||
@@ -242,9 +242,8 @@ func (conn *Conn) receive(tcpconn *net.TCPConn, hasvalidated bool) {
|
|||||||
if config.ShowDebugLog {
|
if config.ShowDebugLog {
|
||||||
logrus.Debugln("[tcp] recv from", ep, "err:", err)
|
logrus.Debugln("[tcp] recv from", ep, "err:", err)
|
||||||
}
|
}
|
||||||
// _ = tcpconn.CloseRead()
|
_ = tcpconn.CloseRead()
|
||||||
// return
|
return
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if r.pckt.typ >= packetTypeTop {
|
if r.pckt.typ >= packetTypeTop {
|
||||||
if config.ShowDebugLog {
|
if config.ShowDebugLog {
|
||||||
|
|||||||
Reference in New Issue
Block a user