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 <pierre.krieger1708@gmail.com>
This commit is contained in:
Kevin Zhang 2020-05-18 02:14:31 -07:00 committed by GitHub
parent bbc67351d3
commit 2fbd1a5503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,7 @@ where
type Future = BoxFuture<'static, Result<Duration, io::Error>>;
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?;