diff options
author | David Fifield <david@bamsoftware.com> | 2022-09-22 17:20:33 -0600 |
---|---|---|
committer | meskio <meskio@torproject.org> | 2022-11-16 18:48:14 +0100 |
commit | 2f55581098ee45a2e19e8272f0130a6447a5f2d0 (patch) | |
tree | 8f14fda1268b7e65d616909ec414fb34662e94b0 | |
parent | 12e8de8b24e0a35e4c4bcc8de8a7a062efd7c35e (diff) | |
download | snowflake-2f55581098ee45a2e19e8272f0130a6447a5f2d0.tar.gz snowflake-2f55581098ee45a2e19e8272f0130a6447a5f2d0.zip |
Reduce the smux KeepAliveTimeout on the server from 10 to 4 minutes.
To save memory, we want to more aggressively close stale connections.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40175
-rw-r--r-- | server/lib/snowflake.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/lib/snowflake.go b/server/lib/snowflake.go index 082e831..469ed91 100644 --- a/server/lib/snowflake.go +++ b/server/lib/snowflake.go @@ -217,7 +217,7 @@ func (l *SnowflakeListener) acceptStreams(conn *kcp.UDPSession) error { smuxConfig := smux.DefaultConfig() smuxConfig.Version = 2 - smuxConfig.KeepAliveTimeout = 10 * time.Minute + smuxConfig.KeepAliveTimeout = 4 * time.Minute smuxConfig.MaxStreamBuffer = StreamSize sess, err := smux.Server(conn, smuxConfig) if err != nil { |