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
This commit is contained in:
David Fifield 2022-09-22 17:20:33 -06:00 committed by meskio
parent 12e8de8b24
commit 2f55581098
No known key found for this signature in database
GPG key ID: 52B8F5AC97A2DA86

View file

@ -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 {