mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -49,6 +49,7 @@ use winreg::RegKey;
|
||||
|
||||
pub fn get_cursor_pos() -> Option<(i32, i32)> {
|
||||
unsafe {
|
||||
#[allow(invalid_value)]
|
||||
let mut out = mem::MaybeUninit::uninit().assume_init();
|
||||
if GetCursorPos(&mut out) == FALSE {
|
||||
return None;
|
||||
@@ -61,6 +62,7 @@ pub fn reset_input_cache() {}
|
||||
|
||||
pub fn get_cursor() -> ResultType<Option<u64>> {
|
||||
unsafe {
|
||||
#[allow(invalid_value)]
|
||||
let mut ci: CURSORINFO = mem::MaybeUninit::uninit().assume_init();
|
||||
ci.cbSize = std::mem::size_of::<CURSORINFO>() as _;
|
||||
if crate::portable_service::client::get_cursor_info(&mut ci) == FALSE {
|
||||
@@ -79,6 +81,7 @@ struct IconInfo(ICONINFO);
|
||||
impl IconInfo {
|
||||
fn new(icon: HICON) -> ResultType<Self> {
|
||||
unsafe {
|
||||
#[allow(invalid_value)]
|
||||
let mut ii = mem::MaybeUninit::uninit().assume_init();
|
||||
if GetIconInfo(icon, &mut ii) == FALSE {
|
||||
Err(io::Error::last_os_error().into())
|
||||
|
||||
@@ -138,7 +138,6 @@ const MILLI1: Duration = Duration::from_millis(1);
|
||||
const SEND_TIMEOUT_VIDEO: u64 = 12_000;
|
||||
const SEND_TIMEOUT_OTHER: u64 = SEND_TIMEOUT_VIDEO * 10;
|
||||
const SESSION_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
const SWITCH_SIDES_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
impl Connection {
|
||||
pub async fn start(
|
||||
@@ -1231,7 +1230,7 @@ impl Connection {
|
||||
SWITCH_SIDES_UUID
|
||||
.lock()
|
||||
.unwrap()
|
||||
.retain(|_, v| v.0.elapsed() < SWITCH_SIDES_TIMEOUT);
|
||||
.retain(|_, v| v.0.elapsed() < Duration::from_secs(10));
|
||||
let uuid_old = SWITCH_SIDES_UUID.lock().unwrap().remove(&lr.my_id);
|
||||
if let Ok(uuid) = uuid::Uuid::from_slice(_s.uuid.to_vec().as_ref()) {
|
||||
if let Some((_instant, uuid_old)) = uuid_old {
|
||||
@@ -1538,8 +1537,8 @@ impl Connection {
|
||||
uuid.to_string().as_ref(),
|
||||
])
|
||||
.ok();
|
||||
self.send_close_reason_no_retry("Closed as expected");
|
||||
self.on_close("switch sides", false);
|
||||
self.send_close_reason_no_retry("Closed as expected").await;
|
||||
self.on_close("switch sides", false).await;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::client::{
|
||||
};
|
||||
use crate::common::{self, GrabState};
|
||||
use crate::keyboard;
|
||||
use crate::ui_interface::using_public_server;
|
||||
use crate::{client::Data, client::Interface};
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
|
||||
Reference in New Issue
Block a user