mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(snownet): extract constant for handshake timeout (#4091)
This commit is contained in:
@@ -38,6 +38,9 @@ const HANDSHAKE_RATE_LIMIT: u64 = 100;
|
||||
/// How long we will at most wait for a candidate from the remote.
|
||||
const CANDIDATE_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
/// How long we will at most wait for an [`Answer`] from the remote.
|
||||
const HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(20);
|
||||
|
||||
const MAX_UDP_SIZE: usize = (1 << 16) - 1;
|
||||
|
||||
/// Manages a set of wireguard connections for a server.
|
||||
@@ -1213,7 +1216,7 @@ impl InitialConnection {
|
||||
where
|
||||
TId: fmt::Display,
|
||||
{
|
||||
if now.duration_since(self.created_at) >= Duration::from_secs(20) {
|
||||
if now.duration_since(self.created_at) >= HANDSHAKE_TIMEOUT {
|
||||
tracing::info!(%id, "Connection setup timed out (no answer received)");
|
||||
self.is_failed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user