Fix: safeConnClose not working (#2463)

This commit is contained in:
wwqgtxx
2022-12-22 12:42:38 +08:00
committed by GitHub
parent d8ac82be36
commit cdc7d449a6
7 changed files with 39 additions and 13 deletions

View File

@ -81,7 +81,9 @@ func (ss *ShadowSocks) DialContext(ctx context.Context, metadata *C.Metadata, op
}
tcpKeepAlive(c)
defer safeConnClose(c, err)
defer func(c net.Conn) {
safeConnClose(c, err)
}(c)
c, err = ss.StreamConn(c, metadata)
return NewConn(c, ss), err