mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-16 13:50:57 +08:00
Refactor(proxy): replace with safeConnClose
This commit is contained in:
@@ -50,11 +50,7 @@ func (ss *Shadowsocks) DialContext(ctx context.Context, metadata *M.Metadata) (c
|
||||
}
|
||||
setKeepAlive(c)
|
||||
|
||||
defer func() {
|
||||
if err != nil && c != nil {
|
||||
c.Close()
|
||||
}
|
||||
}()
|
||||
defer safeConnClose(c, err)
|
||||
|
||||
switch ss.obfsMode {
|
||||
case "tls":
|
||||
|
Reference in New Issue
Block a user