mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 01:31:33 +00:00
[libp2p-ping] Properly close the substream in the InboundUpgrade. (#1606)
Not doing so may result in FIN/RST frames being sent before earlier data frames. See https://github.com/paritytech/yamux/pull/81#issuecomment-643169973.
This commit is contained in:
@ -69,6 +69,7 @@ where
|
|||||||
while let Ok(_) = socket.read_exact(&mut payload).await {
|
while let Ok(_) = socket.read_exact(&mut payload).await {
|
||||||
socket.write_all(&payload).await?;
|
socket.write_all(&payload).await?;
|
||||||
}
|
}
|
||||||
|
socket.close().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}.boxed()
|
}.boxed()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user