From 468d5c4d65355d3e1f19d59b33f13438c1a6addf Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sun, 21 Jul 2024 20:13:20 +0000 Subject: [PATCH] Fix SplitHTTP H3 waited for downResponse before uploading https://github.com/XTLS/Xray-core/issues/3560#issuecomment-2241750579 --- transport/internet/splithttp/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport/internet/splithttp/client.go b/transport/internet/splithttp/client.go index 2a467d7dab93..0cdaf247e9ff 100644 --- a/transport/internet/splithttp/client.go +++ b/transport/internet/splithttp/client.go @@ -9,6 +9,7 @@ import ( "net/http/httptrace" "sync" + "github.com/quic-go/quic-go/http3" "github.com/xtls/xray-core/common" "github.com/xtls/xray-core/common/errors" "github.com/xtls/xray-core/common/net" @@ -94,6 +95,10 @@ func (c *DefaultDialerClient) OpenDownload(ctx context.Context, baseURL string) gotDownResponse.Close() }() + if _, h3 := c.download.Transport.(*http3.RoundTripper); h3 { + gotConn.Close() + } + // we want to block Dial until we know the remote address of the server, // for logging purposes <-gotConn.Wait()