fix: safeConnClose not working

This commit is contained in:
wwqgtxx
2022-12-13 13:20:40 +08:00
parent 17cbbb5bf0
commit bffb0573a6
8 changed files with 51 additions and 17 deletions

View File

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