remove timeout

This commit is contained in:
Jett Chen 2023-12-17 03:37:13 +08:00
parent 9f84fc6efa
commit 669eed0dac

View file

@ -104,18 +104,12 @@ impl Interface {
let mut buf = [0u8; 3000];
let src = {
let src = match timeout(
Duration::from_millis(10),
tun.read().await.recv(&mut buf[..]),
)
.await
{
Ok(Ok(len)) => &buf[..len],
Ok(Err(e)) => {
let src = match tun.read().await.recv(&mut buf[..]).await {
Ok(len) => &buf[..len],
Err(e) => {
error!("failed to read from interface: {}", e);
continue;
}
Err(_would_block) => continue,
};
debug!("read {} bytes from interface", src.len());
debug!("bytes: {:?}", src);