Skip to content

Commit

Permalink
feat(identify): don't flush in
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 committed Jan 27, 2023
1 parent f8efcb3 commit cf21edb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions protocols/identify/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.flush().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,
Expand Down

0 comments on commit cf21edb

Please sign in to comment.