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()