From 30b160fe534882c37ccf7e7d47c8a221c9efe97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C3=A8be=20-=20Romain=20Gerard?= Date: Wed, 22 Nov 2023 14:57:59 +0100 Subject: [PATCH] Avoid overflow of interval --- src/tunnel/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tunnel/io.rs b/src/tunnel/io.rs index 36a0447..6a3ab16 100644 --- a/src/tunnel/io.rs +++ b/src/tunnel/io.rs @@ -25,7 +25,7 @@ pub(super) async fn propagate_read( // We do our own pin_mut! to avoid shadowing timeout and be able to reset it, on next loop iteration // We reuse the future to avoid creating a timer in the tight loop - let frequency = ping_frequency.unwrap_or(Duration::from_secs(u64::MAX)); + let frequency = ping_frequency.unwrap_or(Duration::from_secs(3600 * 24)); let start_at = Instant::now().checked_add(frequency).unwrap_or(Instant::now()); let timeout = tokio::time::interval_at(start_at, frequency); pin_mut!(timeout);