From 38962eba6bddf760591f8fb520b1ae5d44ee6fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Wed, 13 Apr 2022 23:42:35 +0200 Subject: [PATCH] udp: config: make max_connection_age a u32, improve its documentation --- aquatic_udp/src/common.rs | 2 +- aquatic_udp/src/config.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aquatic_udp/src/common.rs b/aquatic_udp/src/common.rs index bce0afe..2249961 100644 --- a/aquatic_udp/src/common.rs +++ b/aquatic_udp/src/common.rs @@ -34,7 +34,7 @@ impl ConnectionValidator { Ok(Self { hmac, start_time: Instant::now(), - max_connection_age: config.cleaning.max_connection_age as u32, + max_connection_age: config.cleaning.max_connection_age, }) } diff --git a/aquatic_udp/src/config.rs b/aquatic_udp/src/config.rs index 962b69e..7823ed8 100644 --- a/aquatic_udp/src/config.rs +++ b/aquatic_udp/src/config.rs @@ -171,8 +171,8 @@ pub struct CleaningConfig { /// lingering for a long time. However, the cleaning also returns unused /// allocated memory to the OS, so the interval can be configured here. pub pending_scrape_cleaning_interval: u64, - /// Maximum time to use a connection token before it expires (seconds) - pub max_connection_age: u64, + /// Allow clients to use a connection token for this long (seconds) + pub max_connection_age: u32, /// Remove peers who have not announced for this long (seconds) pub max_peer_age: u64, /// Remove pending scrape responses that have not been returned from request