Skip to content

Commit

Permalink
XHTTP test: Fix Test_maxUpload
Browse files Browse the repository at this point in the history
  • Loading branch information
RPRX authored Nov 18, 2024
1 parent 2d7b0e8 commit 1f570d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions transport/internet/splithttp/splithttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ func Test_maxUpload(t *testing.T) {
ProtocolSettings: &Config{
Path: "/sh",
ScMaxEachPostBytes: &RandRangeConfig{
From: 100,
To: 100,
From: 10000,
To: 10000,
},
},
}
Expand All @@ -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 {
Expand All @@ -452,19 +452,19 @@ 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" {
t.Error("response: ", string(b[:n]))
}
common.Must(conn.Close())

if uploadSize > 100 || uploadSize == 0 {
if uploadSize > 10000 || uploadSize == 0 {
t.Error("incorrect upload size: ", uploadSize)
}

Expand Down

0 comments on commit 1f570d9

Please sign in to comment.