mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 01:01: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:
@ -7,7 +7,10 @@
|
|||||||
|
|
||||||
- Update to `libp2p-swarm` `v0.42.0`.
|
- Update to `libp2p-swarm` `v0.42.0`.
|
||||||
|
|
||||||
|
- Don't close the stream when reading the identify info in `protocol::recv`. See [PR 3344].
|
||||||
|
|
||||||
[PR 3208]: https://github.com/libp2p/rust-libp2p/pull/3208
|
[PR 3208]: https://github.com/libp2p/rust-libp2p/pull/3208
|
||||||
|
[PR 3344]: https://github.com/libp2p/rust-libp2p/pull/3344
|
||||||
|
|
||||||
# 0.41.1
|
# 0.41.1
|
||||||
|
|
||||||
|
@ -189,11 +189,14 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn recv<T>(mut socket: T) -> Result<Info, UpgradeError>
|
async fn recv<T>(socket: T) -> Result<Info, UpgradeError>
|
||||||
where
|
where
|
||||||
T: AsyncRead + AsyncWrite + Unpin,
|
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(
|
let info = FramedRead::new(
|
||||||
socket,
|
socket,
|
||||||
|
Reference in New Issue
Block a user