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

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