chore: better safeConnClose

This commit is contained in:
wwqgtxx
2022-12-16 22:15:44 +08:00
parent 432c4c2cf1
commit 57592ee840
8 changed files with 18 additions and 18 deletions

View File

@ -67,9 +67,9 @@ func (h *Http) DialContext(ctx context.Context, metadata *C.Metadata, opts ...di
}
tcpKeepAlive(c)
defer func() {
defer func(c net.Conn) {
safeConnClose(c, err)
}()
}(c)
c, err = h.StreamConn(c, metadata)
if err != nil {