From 1bae46b1c065eeb6b39d50c63697f56993184c5f Mon Sep 17 00:00:00 2001 From: Fangliding Date: Fri, 8 May 2026 13:39:42 +0800 Subject: [PATCH] Close body on fail --- transport/internet/splithttp/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport/internet/splithttp/client.go b/transport/internet/splithttp/client.go index c156509a..47f6560a 100644 --- a/transport/internet/splithttp/client.go +++ b/transport/internet/splithttp/client.go @@ -71,6 +71,7 @@ func (c *DefaultDialerClient) OpenStream(ctx context.Context, url string, sessio errors.LogInfoInner(ctx, err, "failed to "+method+" "+url) } gotConn.Close() + common.Close(body) wrc.Close() return } @@ -80,6 +81,7 @@ func (c *DefaultDialerClient) OpenStream(ctx context.Context, url string, sessio if resp.StatusCode != 200 || uploadOnly { // stream-up io.Copy(io.Discard, resp.Body) resp.Body.Close() // if it is called immediately, the upload will be interrupted also + common.Close(body) wrc.Close() return }