diff options
| author | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2025-04-10 18:09:12 +0200 |
|---|---|---|
| committer | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2025-04-10 18:09:12 +0200 |
| commit | 4846498154e58fa06284f49746ed2f0c014f705e (patch) | |
| tree | 5ddf69060af30b6a7a78ddf3ce47eceec958d917 | |
| parent | a79fdc20d12c41e4bdaa2bcc986cf45825a221d8 (diff) | |
| download | mullvadvpn-4846498154e58fa06284f49746ed2f0c014f705e.tar.xz mullvadvpn-4846498154e58fa06284f49746ed2f0c014f705e.zip | |
Remove unused Instant in fragment
| -rw-r--r-- | mullvad-masque-proxy/src/fragment.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/mullvad-masque-proxy/src/fragment.rs b/mullvad-masque-proxy/src/fragment.rs index 3d9fc94273..94aafad574 100644 --- a/mullvad-masque-proxy/src/fragment.rs +++ b/mullvad-masque-proxy/src/fragment.rs @@ -1,7 +1,4 @@ -use std::{ - collections::{BTreeMap, VecDeque}, - time::{Duration, Instant}, -}; +use std::collections::{BTreeMap, VecDeque}; use bytes::{Buf, BufMut, Bytes, BytesMut}; use h3::proto::varint::VarInt; @@ -79,11 +76,7 @@ impl Fragments { let fragment_count = payload .try_get_u8() .map_err(|_| DefragError::PayloadTooSmall)?; - let fragment = Fragment { - index, - payload, - time_received: Instant::now(), - }; + let fragment = Fragment { index, payload }; // ensure that the fifo has capacity before pushing the new fragment id if self.fragment_index_fifo.len() >= FRAGMENT_BUFFER_CAP { @@ -140,20 +133,11 @@ impl Fragments { Some(payload) } - - pub fn clear_old_fragments(&mut self, max_age: Duration) { - self.fragment_map.retain(|_, fragments| { - fragments - .iter() - .any(|fragment| fragment.time_received.elapsed() <= max_age) - }); - } } struct Fragment { index: u8, payload: Bytes, - time_received: Instant, } /// Fragment packet using the given maximum fragment size (including headers). |
