mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:34:02 +03:00
Add separate handshake timeout
This PR adds a new setting to the config: `network.timeout`. This setting defines a time period during which all handshake procedures and ceremonies must be completed. If not - connection is aborted. This should help in situations when connection is established but client cannot continue for some reason (for example, RST sent by some middle box).
This commit is contained in:
@@ -81,6 +81,10 @@ const (
|
||||
// avoid racing with MTProto ping_delay_disconnect (~60s interval).
|
||||
DefaultIdleTimeout = 5 * time.Minute
|
||||
|
||||
// DefaultHandshakeTimeout defines a time period during which the
|
||||
// all handshake ceremonies must be completed.
|
||||
DefaultHandshakeTimeout = 10 * time.Second
|
||||
|
||||
// DefaultTolerateTimeSkewness is a default timeout for time skewness on a
|
||||
// faketls timeout verification.
|
||||
DefaultTolerateTimeSkewness = 3 * time.Second
|
||||
|
||||
Reference in New Issue
Block a user