mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-20 19:51:04 +03:00
fix, RwLock, remove nested read calls
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -1042,24 +1042,6 @@ pub async fn get_key(sync: bool) -> String {
|
||||
key
|
||||
}
|
||||
|
||||
pub fn is_peer_version_ge(v: &str) -> bool {
|
||||
#[cfg(not(any(feature = "flutter", feature = "cli")))]
|
||||
if let Some(session) = crate::ui::CUR_SESSION.lock().unwrap().as_ref() {
|
||||
return session.get_peer_version() >= hbb_common::get_version_number(v);
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
if let Some(session) = crate::flutter::SESSIONS
|
||||
.read()
|
||||
.unwrap()
|
||||
.get(&*crate::flutter::CUR_SESSION_ID.read().unwrap())
|
||||
{
|
||||
return session.get_peer_version() >= hbb_common::get_version_number(v);
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn pk_to_fingerprint(pk: Vec<u8>) -> String {
|
||||
let s: String = pk.iter().map(|u| format!("{:02x}", u)).collect();
|
||||
s.chars()
|
||||
|
||||
Reference in New Issue
Block a user