refactor, will do with shared memory

This commit is contained in:
rustdesk
2021-08-10 16:01:39 +08:00
parent c3a3c1a1c7
commit 61caaa3365
4 changed files with 2 additions and 47 deletions

View File

@@ -19,7 +19,6 @@ use sha2::{Digest, Sha256};
pub type Sender = mpsc::UnboundedSender<(Instant, Arc<Message>)>;
lazy_static::lazy_static! {
static ref CLICK_TIME: Arc::<Mutex<i64>> = Default::default();
static ref LOGIN_FAILURES: Arc::<Mutex<HashMap<String, (i32, i32, i32)>>> = Default::default();
}
@@ -637,9 +636,6 @@ impl Connection {
Some(message::Union::mouse_event(me)) => {
if self.keyboard {
handle_mouse(&me, self.inner.id());
if is_left_up(&me) {
*CLICK_TIME.lock().unwrap() = crate::get_time();
}
}
}
Some(message::Union::key_event(mut me)) => {
@@ -666,9 +662,6 @@ impl Connection {
} else {
handle_key(&me);
}
if is_enter(&me) {
*CLICK_TIME.lock().unwrap() = crate::get_time();
}
}
}
Some(message::Union::clipboard(cb)) => {
@@ -945,18 +938,7 @@ async fn start_ipc(
return Err(err.into());
}
Ok(Some(data)) => {
match data {
ipc::Data::ClickTime(_)=> {
unsafe {
let ct = *CLICK_TIME.lock().unwrap();
let data = ipc::Data::ClickTime(ct);
stream.send(&data).await?;
}
}
_ => {
tx_from_cm.send(data)?;
}
}
tx_from_cm.send(data)?;
}
_ => {}
}