From ed0be85550f4a0af0301f463d6d1631665c76e3a Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 27 May 2024 19:02:09 +0200 Subject: [PATCH] fix: drop before decoding for less contention --- src/tcp/control.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tcp/control.rs b/src/tcp/control.rs index 12d5bd1..fa67c2b 100644 --- a/src/tcp/control.rs +++ b/src/tcp/control.rs @@ -41,6 +41,7 @@ impl ControlChannel { let size = rx.read_u32().await?; let mut buffer = vec![0u8; size as usize]; rx.read_exact(&mut buffer).await?; + drop(rx); super::proto::Packet::decode(id, &buffer) } }