mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11: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>>;
|
type Future = BoxFuture<'static, Result<Duration, io::Error>>;
|
||||||
|
|
||||||
fn upgrade_outbound(self, mut socket: TSocket, _: Self::Info) -> Self::Future {
|
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);
|
debug!("Preparing ping payload {:?}", payload);
|
||||||
async move {
|
async move {
|
||||||
socket.write_all(&payload).await?;
|
socket.write_all(&payload).await?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user