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

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