From 2f55581098ee45a2e19e8272f0130a6447a5f2d0 Mon Sep 17 00:00:00 2001 From: David Fifield Date: Thu, 22 Sep 2022 17:20:33 -0600 Subject: [PATCH] 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 --- server/lib/snowflake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {