server hid stream fix
This commit is contained in:
parent
b63e04ff95
commit
ae5c9f4f25
@ -158,7 +158,13 @@ impl Relay for Handler {
|
|||||||
.map(|b| format!("{b:02X}")).collect::<Vec<_>>().join(" "));
|
.map(|b| format!("{b:02X}")).collect::<Vec<_>>().join(" "));
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
Err(e) if matches!(e.raw_os_error(), Some(libc::EBUSY) | Some(libc::EAGAIN)) => {
|
Err(e)
|
||||||
|
if matches!(e.raw_os_error(),
|
||||||
|
Some(libc::EBUSY) | // still opening
|
||||||
|
Some(libc::ENODEV) | // gadget not‑yet configured
|
||||||
|
Some(libc::EPIPE) | // host vanished
|
||||||
|
Some(libc::EAGAIN)) // non‑blocking
|
||||||
|
=> {
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -191,7 +197,13 @@ impl Relay for Handler {
|
|||||||
.map(|b| format!("{b:02X}")).collect::<Vec<_>>().join(" "));
|
.map(|b| format!("{b:02X}")).collect::<Vec<_>>().join(" "));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Err(e) if matches!(e.raw_os_error(), Some(libc::EBUSY) | Some(libc::EAGAIN)) => {
|
Err(e)
|
||||||
|
if matches!(e.raw_os_error(),
|
||||||
|
Some(libc::EBUSY) | // still opening
|
||||||
|
Some(libc::ENODEV) | // gadget not‑yet configured
|
||||||
|
Some(libc::EPIPE) | // host vanished
|
||||||
|
Some(libc::EAGAIN)) // non‑blocking
|
||||||
|
=> {
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user