remove timeout
This commit is contained in:
parent
9f84fc6efa
commit
669eed0dac
1 changed files with 3 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue