server updates

This commit is contained in:
Brad Stein 2025-06-16 21:47:01 -05:00
parent 9f1a371152
commit 5917291d12
2 changed files with 6 additions and 3 deletions

View File

@ -30,7 +30,7 @@ else
fi
# 4. build (as the normal user avoids root-owned Cargo.lock)
sudo -u "$ORIG_USER" bash -c "cd '$SRC_DIR/server' && cargo build --release"
sudo -u "$ORIG_USER" bash -c "cd '$SRC_DIR/server' && cargo clean && cargo build --release"
# 5. install payload
sudo install -Dm755 "$SRC_DIR/server/target/release/navka-server" /usr/local/bin/navka-server

View File

@ -1,5 +1,5 @@
//! navka-server — receive HidReport and write to /dev/hidg0
// main.rs
// sever/src/main.rs
#![forbid(unsafe_code)]
use std::{pin::Pin, sync::Arc, panic::AssertUnwindSafe};
@ -104,9 +104,12 @@ impl Relay for Handler {
error!("‼️ stream task panicked with unknown payload");
}
}
info!("🔚 client closed the upstream");
});
Ok(Response::new(Box::pin(ReceiverStream::new(rx))))
/* This is a **writeonly** stream we keep it open forever. */
use futures_util::stream::pending;
Ok(Response::new(Box::pin(pending::<Result<HidReport, Status>>())))
}
}