mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
add kcp setting adjustment SNOWFLAKE_TEST_KCP_FAST3MODE
This commit is contained in:
parent
93d303b47b
commit
ad5edd3f01
2 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue