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

@ -41,6 +41,7 @@ import (
"log"
"net"
"net/http"
"os"
"sync"
"time"
@ -265,6 +266,14 @@ func (l *SnowflakeListener) acceptSessions(ln *kcp.Listener) error {
0, // default resend
1, // nc=1 => congestion window off
)
if os.Getenv("SNOWFLAKE_TEST_KCP_FAST3MODE") == "1" {
conn.SetNoDelay(
1,
10,
2,
1,
)
}
go func() {
defer conn.Close()
err := l.acceptStreams(conn)