Skip to content
Snippets Groups Projects
Commit e9d446a4 authored by Pierre Krieger's avatar Pierre Krieger Committed by GitHub
Browse files

Use AsyncReadExt::read_exact, not just read (#6977)

parent d0a58a73
No related merge requests found
......@@ -148,7 +148,7 @@ where TSubstream: AsyncRead + AsyncWrite + Unpin + Send + 'static,
let mut initial_message = vec![0u8; initial_message_len];
if !initial_message.is_empty() {
socket.read(&mut initial_message).await?;
socket.read_exact(&mut initial_message).await?;
}
let substream = NotificationsInSubstream {
......@@ -300,7 +300,7 @@ where TSubstream: AsyncRead + AsyncWrite + Unpin + Send + 'static,
let mut handshake = vec![0u8; handshake_len];
if !handshake.is_empty() {
socket.read(&mut handshake).await?;
socket.read_exact(&mut handshake).await?;
}
Ok((handshake, NotificationsOutSubstream {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment