mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 16:51:34 +00:00
fix(identify): don't close stream in protocol::recv
Don't close the stream `protocol::recv`. This is a short-term fix for #3298. The issue behind this is a general one on the QUIC transport when closing streams, as described in #3343. This PR only circumvents the issue for identify. A proper solution for our QUIC transport still needs more thought. Pull-Request: #3344.
This commit is contained in:
@ -189,11 +189,14 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn recv<T>(mut socket: T) -> Result<Info, UpgradeError>
|
||||
async fn recv<T>(socket: T) -> Result<Info, UpgradeError>
|
||||
where
|
||||
T: AsyncRead + AsyncWrite + Unpin,
|
||||
{
|
||||
socket.close().await?;
|
||||
// Even though we won't write to the stream anymore we don't close it here.
|
||||
// The reason for this is that the `close` call on some transport's require the
|
||||
// remote's ACK, but it could be that the remote already dropped the stream
|
||||
// after finishing their write.
|
||||
|
||||
let info = FramedRead::new(
|
||||
socket,
|
||||
|
Reference in New Issue
Block a user