mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 04:41:04 +00:00
Use AsyncReadExt::read_exact, not just read (#6977)
This commit is contained in:
@@ -148,7 +148,7 @@ where TSubstream: AsyncRead + AsyncWrite + Unpin + Send + 'static,
|
|||||||
|
|
||||||
let mut initial_message = vec![0u8; initial_message_len];
|
let mut initial_message = vec![0u8; initial_message_len];
|
||||||
if !initial_message.is_empty() {
|
if !initial_message.is_empty() {
|
||||||
socket.read(&mut initial_message).await?;
|
socket.read_exact(&mut initial_message).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let substream = NotificationsInSubstream {
|
let substream = NotificationsInSubstream {
|
||||||
@@ -300,7 +300,7 @@ where TSubstream: AsyncRead + AsyncWrite + Unpin + Send + 'static,
|
|||||||
|
|
||||||
let mut handshake = vec![0u8; handshake_len];
|
let mut handshake = vec![0u8; handshake_len];
|
||||||
if !handshake.is_empty() {
|
if !handshake.is_empty() {
|
||||||
socket.read(&mut handshake).await?;
|
socket.read_exact(&mut handshake).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok((handshake, NotificationsOutSubstream {
|
Ok((handshake, NotificationsOutSubstream {
|
||||||
|
|||||||
Reference in New Issue
Block a user