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

fix(p2p): tcp sub conn add close write

This commit is contained in:
源文雨
2024-08-08 13:35:04 +08:00
parent 4a2b6c3f90
commit c7cfd94ae2

View File

@@ -137,6 +137,15 @@ func (conn *Conn) accept() {
}
func delsubs(i int, subs []*subconn) []*subconn {
tcpconn := subs[i].conn
err := tcpconn.CloseWrite()
if config.ShowDebugLog {
if err != nil {
logrus.Debugln("[tcp] close sub write from", tcpconn.LocalAddr(), "to", tcpconn.RemoteAddr(), "err:", err)
} else {
logrus.Debugln("[tcp] close sub write from", tcpconn.LocalAddr(), "to", tcpconn.RemoteAddr())
}
}
switch i {
case 0:
subs = subs[1:]