From cc6586fac125fb916cc989328bc2ef70c22e57b2 Mon Sep 17 00:00:00 2001 From: eric Date: Sun, 21 Jan 2024 01:22:12 +0800 Subject: [PATCH] outbound/failover: avoid stack buffer allocation --- leaf/src/proxy/failover/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaf/src/proxy/failover/mod.rs b/leaf/src/proxy/failover/mod.rs index a97b50d..0722a1a 100644 --- a/leaf/src/proxy/failover/mod.rs +++ b/leaf/src/proxy/failover/mod.rs @@ -138,7 +138,7 @@ pub(self) async fn health_check( if send.send_to(&msg_buf, &addr).await.is_err() { return Measure(idx, u128::MAX - 2); } - let mut buf = [0u8; 1500]; + let mut buf = vec![0u8; 1500]; match recv.recv_from(&mut buf).await { Ok(_) => { let elapsed = tokio::time::Instant::now().duration_since(start);