From 1f570d9cefb750b9f1d3730ce21a7c6341e1bd6f Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Mon, 18 Nov 2024 04:53:21 +0000 Subject: [PATCH] XHTTP test: Fix Test_maxUpload https://github.com/XTLS/Xray-core/pull/3260#issuecomment-2481946715 --- transport/internet/splithttp/splithttp_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/transport/internet/splithttp/splithttp_test.go b/transport/internet/splithttp/splithttp_test.go index b01727e0..c349f8f5 100644 --- a/transport/internet/splithttp/splithttp_test.go +++ b/transport/internet/splithttp/splithttp_test.go @@ -424,8 +424,8 @@ func Test_maxUpload(t *testing.T) { ProtocolSettings: &Config{ Path: "/sh", ScMaxEachPostBytes: &RandRangeConfig{ - From: 100, - To: 100, + From: 10000, + To: 10000, }, }, } @@ -434,7 +434,7 @@ func Test_maxUpload(t *testing.T) { listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { go func(c stat.Connection) { defer c.Close() - var b [1024]byte + var b [10240]byte c.SetReadDeadline(time.Now().Add(2 * time.Second)) n, err := c.Read(b[:]) if err != nil { @@ -452,11 +452,11 @@ func Test_maxUpload(t *testing.T) { conn, err := Dial(ctx, net.TCPDestination(net.DomainAddress("localhost"), listenPort), streamSettings) // send a slightly too large upload - var upload [101]byte + var upload [10001]byte _, err = conn.Write(upload[:]) common.Must(err) - var b [1024]byte + var b [10240]byte n, _ := io.ReadFull(conn, b[:]) fmt.Println("string is", n) if string(b[:n]) != "Response" { @@ -464,7 +464,7 @@ func Test_maxUpload(t *testing.T) { } common.Must(conn.Close()) - if uploadSize > 100 || uploadSize == 0 { + if uploadSize > 10000 || uploadSize == 0 { t.Error("incorrect upload size: ", uploadSize) }