Compare commits

...

4 Commits

Author SHA1 Message Date
ac11f91d79 games_in_download: Mutex -> RwLock 2025-08-27 21:29:55 +02:00
8e76e8d1e2 introduce cargo vet 2025-08-27 21:21:01 +02:00
3b6fc80578 [deps] cargo update 2025-08-27 19:55:56 +02:00
8c6fd139c8 [deps] cargo update 2025-08-20 08:54:56 +02:00
5 changed files with 4397 additions and 192 deletions

402
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@ use lanspread_db::db::{Game, GameDB};
use lanspread_mdns::{LANSPREAD_INSTANCE_NAME, LANSPREAD_SERVICE_TYPE, discover_service};
use tauri::{AppHandle, Emitter as _, Manager};
use tauri_plugin_shell::{ShellExt, process::Command};
use tokio::sync::{Mutex, RwLock, mpsc::UnboundedSender};
use tokio::sync::{RwLock, mpsc::UnboundedSender};
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
@@ -19,7 +19,7 @@ struct LanSpreadState {
server_addr: RwLock<Option<SocketAddr>>,
client_ctrl: UnboundedSender<ClientCommand>,
games: Arc<RwLock<GameDB>>,
games_in_download: Arc<Mutex<HashSet<String>>>,
games_in_download: Arc<RwLock<HashSet<String>>>,
games_folder: Arc<RwLock<String>>,
}
@@ -35,7 +35,7 @@ fn request_games(state: tauri::State<LanSpreadState>) {
#[tauri::command]
fn install_game(id: String, state: tauri::State<LanSpreadState>) -> bool {
let already_in_download = tauri::async_runtime::block_on(async {
if state.inner().games_in_download.lock().await.contains(&id) {
if state.inner().games_in_download.read().await.contains(&id) {
log::warn!("Game is already downloading: {id}");
return true;
}
@@ -356,7 +356,7 @@ pub fn run() {
server_addr: RwLock::new(None),
client_ctrl: tx_client_control,
games: Arc::new(RwLock::new(GameDB::empty())),
games_in_download: Arc::new(Mutex::new(HashSet::new())),
games_in_download: Arc::new(RwLock::new(HashSet::new())),
games_folder: Arc::new(RwLock::new(String::new())),
};
@@ -416,7 +416,7 @@ pub fn run() {
.state::<LanSpreadState>()
.inner()
.games_in_download
.lock()
.write()
.await
.insert(id.clone());
@@ -434,7 +434,7 @@ pub fn run() {
.state::<LanSpreadState>()
.inner()
.games_in_download
.lock()
.write()
.await
.remove(&id.clone());
@@ -467,7 +467,7 @@ pub fn run() {
.state::<LanSpreadState>()
.inner()
.games_in_download
.lock()
.write()
.await
.remove(&id.clone());
},

7
supply-chain/audits.toml Normal file
View File

@@ -0,0 +1,7 @@
# cargo-vet audits file
[[audits.windows-link]]
who = "ddidderr <ddidderr@paul.network>"
criteria = "safe-to-deploy"
delta = "0.1.1 -> 0.1.3"

2184
supply-chain/config.toml Normal file

File diff suppressed because it is too large Load Diff

1982
supply-chain/imports.lock Normal file

File diff suppressed because it is too large Load Diff