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:
Elena Frank
2023-02-19 22:18:54 +01:00
committed by GitHub
parent 0f4930f92b
commit 79b7cef070
2 changed files with 8 additions and 2 deletions

View File

@ -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,