mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
feat(snownet): timeout connections without a handshake after 20 seconds (#3633)
It was discovered by @conectado that this timeout needs to be longer than 10 seconds.
This commit is contained in:
@@ -543,7 +543,7 @@ where
|
||||
.initial
|
||||
.iter()
|
||||
.filter_map(|(id, conn)| {
|
||||
(now.duration_since(conn.created_at) >= Duration::from_secs(10)).then_some(*id)
|
||||
(now.duration_since(conn.created_at) >= Duration::from_secs(20)).then_some(*id)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ fn connection_times_out_after_10_seconds() {
|
||||
ClientNode::<u64>::new(StaticSecret::random_from_rng(rand::thread_rng()), start);
|
||||
|
||||
let _ = alice.new_connection(1, HashSet::new(), HashSet::new());
|
||||
alice.handle_timeout(start + Duration::from_secs(10));
|
||||
alice.handle_timeout(start + Duration::from_secs(20));
|
||||
|
||||
assert_eq!(alice.poll_event().unwrap(), Event::ConnectionFailed(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user