diff --git a/audioipc/Cargo.toml b/audioipc/Cargo.toml index 5fba216..f09dd87 100644 --- a/audioipc/Cargo.toml +++ b/audioipc/Cargo.toml @@ -30,7 +30,7 @@ memmap2 = "0.9" arrayvec = "0.7" [target.'cfg(target_os = "linux")'.dependencies.audio_thread_priority] -version = "0.34" +version = "0.35" default-features = false [target.'cfg(windows)'.dependencies] diff --git a/client/Cargo.toml b/client/Cargo.toml index 5ab50f1..8ed529e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -13,4 +13,4 @@ edition = "2018" audioipc = { package = "audioipc2", path = "../audioipc" } cubeb-backend = "0.32" log = "0.4" -audio_thread_priority = { version = "0.34", default-features = false } +audio_thread_priority = { version = "0.35", default-features = false } diff --git a/server/Cargo.toml b/server/Cargo.toml index 3395529..6059af2 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -15,5 +15,5 @@ cubeb-core = "0.32" once_cell = "1.2.0" log = "0.4" slab = "0.4" -audio_thread_priority = { version = "0.34", default-features = false } +audio_thread_priority = { version = "0.35", default-features = false } diff --git a/server/src/server.rs b/server/src/server.rs index a9971d0..9033741 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -677,12 +677,20 @@ impl CubebServer { #[cfg(target_os = "linux")] ServerMessage::PromoteThreadToRealTime(thread_info) => { let info = RtPriorityThreadInfo::deserialize(thread_info); - match promote_thread_to_real_time(info, 0, 48000) { - Ok(_) => { - info!("Promotion of content process thread to real-time OK"); - } - Err(_) => { - warn!("Promotion of content process thread to real-time error"); + if info.pid() as u32 != self.remote_pid.unwrap() { + warn!( + "PromoteThreadToRealTime: client supplied pid {} doesn't match trusted pid {}", + info.pid(), + self.remote_pid.unwrap() + ); + } else { + match promote_thread_to_real_time(info, 0, 48000) { + Ok(_) => { + info!("Promotion of content process thread to real-time OK"); + } + Err(_) => { + warn!("Promotion of content process thread to real-time error"); + } } } ClientMessage::ThreadPromoted