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:
9seconds
2026-04-07 08:01:51 +02:00
parent 45f958e527
commit eb564936c7
11 changed files with 42 additions and 55 deletions
+4
View File
@@ -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