aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCecylia Bocovich <cohosh@torproject.org>2020-12-16 10:19:28 -0500
committerCecylia Bocovich <cohosh@torproject.org>2020-12-17 09:54:18 -0500
commitf908576c604e812c70e4b4ef8d12b5ebd55f3166 (patch)
treec84bcddb16c245933e342a44e01507c33e2fbaac
parent8ec8a7cb635f1eaf36eadff06c653e73fe553817 (diff)
downloadsnowflake-f908576c604e812c70e4b4ef8d12b5ebd55f3166.tar.gz
snowflake-f908576c604e812c70e4b4ef8d12b5ebd55f3166.zip
Increase the KCP maximum window size
-rw-r--r--client/lib/snowflake.go3
-rw-r--r--server/server.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/client/lib/snowflake.go b/client/lib/snowflake.go
index 10a2c0d..2ed51a1 100644
--- a/client/lib/snowflake.go
+++ b/client/lib/snowflake.go
@@ -69,6 +69,9 @@ func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, e
}
// Permit coalescing the payloads of consecutive sends.
conn.SetStreamMode(true)
+ // Set the maximum send and receive window sizes to a high number
+ // Removes KCP bottlenecks: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40026
+ conn.SetWindowSize(65535, 65535)
// Disable the dynamic congestion window (limit only by the
// maximum of local and remote static windows).
conn.SetNoDelay(
diff --git a/server/server.go b/server/server.go
index 1a53de7..3b263d0 100644
--- a/server/server.go
+++ b/server/server.go
@@ -338,6 +338,9 @@ func acceptSessions(ln *kcp.Listener) error {
}
// Permit coalescing the payloads of consecutive sends.
conn.SetStreamMode(true)
+ // Set the maximum send and receive window sizes to a high number
+ // Removes KCP bottlenecks: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40026
+ conn.SetWindowSize(65535, 65535)
// Disable the dynamic congestion window (limit only by the
// maximum of local and remote static windows).
conn.SetNoDelay(