add kcp setting adjustment SNOWFLAKE_TEST_KCP_FAST3MODE

This commit is contained in:
Shelikhoo 2023-12-19 14:59:45 +00:00 committed by WofWca
parent 93d303b47b
commit ad5edd3f01
2 changed files with 18 additions and 0 deletions

View file

@ -32,6 +32,7 @@ import (
"math/rand"
"net"
"net/url"
"os"
"strings"
"time"
@ -385,6 +386,14 @@ func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, e
0, // default resend
1, // nc=1 => congestion window off
)
if os.Getenv("SNOWFLAKE_TEST_KCP_FAST3MODE") == "1" {
conn.SetNoDelay(
1,
10,
2,
1,
)
}
// On the KCP connection we overlay an smux session and stream.
smuxConfig := smux.DefaultConfig()
smuxConfig.Version = 2