Changed read to read_exact for reading sphinx packets to increase reliability

This commit is contained in:
Jedrzej Stuczynski
2020-03-09 16:42:46 +00:00
parent 9b7b359351
commit aa7898eca2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ async fn process_socket_connection(
) {
let mut buf = [0u8; sphinx::PACKET_SIZE];
loop {
match socket.read(&mut buf).await {
match socket.read_exact(&mut buf).await {
// socket closed
Ok(n) if n == 0 => {
trace!("Remote connection closed.");