mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 03:02:12 +00:00
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:
parent
bbc67351d3
commit
2fbd1a5503
@ -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?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user