Don't block on reads with an empty buffer

This commit is contained in:
pjht 2024-09-15 17:01:41 -05:00
parent 5389c01ec6
commit 6ffbeae625
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -27,10 +27,6 @@ impl file_rpc::Server for FileServ {
_pos: u64,
len: usize,
) -> std::result::Result<std::borrow::Cow<'_, [u8]>, ()> {
while KEYPRESS_BUF.lock().is_empty() {
ipc::process_messages();
process_keyboard_data();
}
let mut encode_buf = [0u8; 4];
let mut buf = vec![];
let mut remaining_len = len;