mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-22 19:40:35 +08:00
fix(p2p): close receive on certain errors
This commit is contained in:
@@ -242,8 +242,11 @@ 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()
|
if errors.Is(err, net.ErrClosed) || errors.Is(err, io.ErrClosedPipe) {
|
||||||
return
|
_ = tcpconn.CloseRead()
|
||||||
|
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