mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 23:14:02 +03:00
fix: apply idle timeout to Telegram relay
Wrap both sides of the Telegram relay in connIdleTimeout, same as already done for domain fronting in #416. Without this, if a client disappears (network drop, battery dies), the TCP connection stays formally alive and the goroutine in the worker pool blocks on io.CopyBuffer indefinitely. Under mass client disconnects this accumulates zombie goroutines. Fixes #417
This commit is contained in:
+2
-2
@@ -105,8 +105,8 @@ func (p *Proxy) ServeConn(conn essentials.Conn) {
|
||||
relay.Relay(
|
||||
ctx,
|
||||
ctx.logger.Named("relay"),
|
||||
ctx.telegramConn,
|
||||
ctx.clientConn,
|
||||
connIdleTimeout{Conn: ctx.telegramConn, timeout: p.idleTimeout},
|
||||
connIdleTimeout{Conn: ctx.clientConn, timeout: p.idleTimeout},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user