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

fix(p2p): close receive on certain errors

This commit is contained in:
源文雨
2024-08-08 13:26:20 +08:00
parent d5d7a9412f
commit 4a2b6c3f90

View File

@@ -242,8 +242,11 @@ func (conn *Conn) receive(tcpconn *net.TCPConn, hasvalidated bool) {
if config.ShowDebugLog {
logrus.Debugln("[tcp] recv from", ep, "err:", err)
}
_ = tcpconn.CloseRead()
return
if errors.Is(err, net.ErrClosed) || errors.Is(err, io.ErrClosedPipe) {
_ = tcpconn.CloseRead()
return
}
continue
}
if r.pckt.typ >= packetTypeTop {
if config.ShowDebugLog {