From 2fbd1a55031bc18e3bcb7816b83ca9ea462b7ee1 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Mon, 18 May 2020 02:14:31 -0700 Subject: [PATCH] Keep consistency with Upgrade Inbound by using PING_SIZE (#1578) although 32 is prefect fine in our case, it would be consistent to use the const value PING_SIZE. Co-authored-by: Pierre Krieger --- protocols/ping/src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/ping/src/protocol.rs b/protocols/ping/src/protocol.rs index 9bd5682f..fab16b36 100644 --- a/protocols/ping/src/protocol.rs +++ b/protocols/ping/src/protocol.rs @@ -83,7 +83,7 @@ where type Future = BoxFuture<'static, Result>; fn upgrade_outbound(self, mut socket: TSocket, _: Self::Info) -> Self::Future { - let payload: [u8; 32] = thread_rng().sample(distributions::Standard); + let payload: [u8; PING_SIZE] = thread_rng().sample(distributions::Standard); debug!("Preparing ping payload {:?}", payload); async move { socket.write_all(&payload).await?;