Ignore TCP recv if failed (#1519)

This commit is contained in:
Andrea Fioraldi 2023-09-15 13:18:46 +02:00 committed by GitHub
parent b3e82ad36e
commit acecf46fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,7 +171,7 @@ where
spawn(async move { spawn(async move {
// In a loop, read data from the socket and write the data back. // In a loop, read data from the socket and write the data back.
loop { loop {
let buf: Vec<u8> = rx_inner.recv().await.expect("Could not receive"); let buf: Vec<u8> = rx_inner.recv().await.unwrap_or(vec![]);
#[cfg(feature = "tcp_debug")] #[cfg(feature = "tcp_debug")]
println!("{buf:?}"); println!("{buf:?}");