Fix misspelled words
This commit is contained in:
parent
70a4ee4318
commit
2758f6b7d5
@ -546,7 +546,7 @@ async fn launch_server(session_id: DWORD, close_first: bool) -> ResultType<HANDL
|
||||
let wstr = wstr.as_ptr();
|
||||
let h = unsafe { LaunchProcessWin(wstr, session_id, FALSE) };
|
||||
if h.is_null() {
|
||||
log::error!("Failed to luanch server: {}", get_error());
|
||||
log::error!("Failed to launch server: {}", get_error());
|
||||
}
|
||||
Ok(h)
|
||||
}
|
||||
@ -605,7 +605,7 @@ fn send_sas() {
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref SUPRESS: Arc<Mutex<Instant>> = Arc::new(Mutex::new(Instant::now()));
|
||||
static ref SUPPRESS: Arc<Mutex<Instant>> = Arc::new(Mutex::new(Instant::now()));
|
||||
}
|
||||
|
||||
pub fn desktop_changed() -> bool {
|
||||
@ -617,7 +617,7 @@ pub fn try_change_desktop() -> bool {
|
||||
if inputDesktopSelected() == FALSE {
|
||||
let res = selectInputDesktop() == TRUE;
|
||||
if !res {
|
||||
let mut s = SUPRESS.lock().unwrap();
|
||||
let mut s = SUPPRESS.lock().unwrap();
|
||||
if s.elapsed() > std::time::Duration::from_secs(3) {
|
||||
log::error!("Failed to switch desktop: {}", get_error());
|
||||
*s = Instant::now();
|
||||
|
@ -120,13 +120,13 @@ impl Connection {
|
||||
return;
|
||||
}
|
||||
if !conn.keyboard {
|
||||
conn.send_permisssion(Permission::Keyboard, false).await;
|
||||
conn.send_permission(Permission::Keyboard, false).await;
|
||||
}
|
||||
if !conn.clipboard {
|
||||
conn.send_permisssion(Permission::Clipboard, false).await;
|
||||
conn.send_permission(Permission::Clipboard, false).await;
|
||||
}
|
||||
if !conn.audio {
|
||||
conn.send_permisssion(Permission::Audio, false).await;
|
||||
conn.send_permission(Permission::Audio, false).await;
|
||||
}
|
||||
let mut test_delay_timer =
|
||||
time::interval_at(Instant::now() + TEST_DELAY_TIMEOUT, TEST_DELAY_TIMEOUT);
|
||||
@ -164,7 +164,7 @@ impl Connection {
|
||||
log::info!("Change permission {} -> {}", name, enabled);
|
||||
if &name == "keyboard" {
|
||||
conn.keyboard = enabled;
|
||||
conn.send_permisssion(Permission::Keyboard, enabled).await;
|
||||
conn.send_permission(Permission::Keyboard, enabled).await;
|
||||
if let Some(s) = conn.server.upgrade() {
|
||||
s.write().unwrap().subscribe(
|
||||
NAME_CURSOR,
|
||||
@ -172,7 +172,7 @@ impl Connection {
|
||||
}
|
||||
} else if &name == "clipboard" {
|
||||
conn.clipboard = enabled;
|
||||
conn.send_permisssion(Permission::Clipboard, enabled).await;
|
||||
conn.send_permission(Permission::Clipboard, enabled).await;
|
||||
if let Some(s) = conn.server.upgrade() {
|
||||
s.write().unwrap().subscribe(
|
||||
super::clipboard_service::NAME,
|
||||
@ -180,7 +180,7 @@ impl Connection {
|
||||
}
|
||||
} else if &name == "audio" {
|
||||
conn.audio = enabled;
|
||||
conn.send_permisssion(Permission::Audio, enabled).await;
|
||||
conn.send_permission(Permission::Audio, enabled).await;
|
||||
if let Some(s) = conn.server.upgrade() {
|
||||
s.write().unwrap().subscribe(
|
||||
super::audio_service::NAME,
|
||||
@ -331,7 +331,7 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
|
||||
async fn send_permisssion(&mut self, permission: Permission, enabled: bool) {
|
||||
async fn send_permission(&mut self, permission: Permission, enabled: bool) {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_permission_info(PermissionInfo {
|
||||
permission: permission.into(),
|
||||
|
@ -34,7 +34,7 @@ pub trait Reset {
|
||||
pub struct ServiceTmpl<T: Subscriber + From<ConnInner>>(Arc<RwLock<ServiceInner<T>>>);
|
||||
pub struct ServiceSwap<T: Subscriber + From<ConnInner>>(ServiceTmpl<T>);
|
||||
pub type GenericService = ServiceTmpl<ConnInner>;
|
||||
pub const HIBERATE_TIMEOUT: u64 = 30;
|
||||
pub const HIBERNATE_TIMEOUT: u64 = 30;
|
||||
pub const MAX_ERROR_TIMEOUT: u64 = 1_000;
|
||||
|
||||
impl<T: Subscriber + From<ConnInner>> ServiceInner<T> {
|
||||
@ -191,7 +191,7 @@ impl<T: Subscriber + From<ConnInner>> ServiceTmpl<T> {
|
||||
let sp = self.clone();
|
||||
let mut callback = callback;
|
||||
let thread = thread::spawn(move || {
|
||||
let mut error_timeout = HIBERATE_TIMEOUT;
|
||||
let mut error_timeout = HIBERNATE_TIMEOUT;
|
||||
while sp.active() {
|
||||
if sp.has_subscribes() {
|
||||
log::debug!("Enter {} service inner loop", sp.name());
|
||||
@ -199,7 +199,7 @@ impl<T: Subscriber + From<ConnInner>> ServiceTmpl<T> {
|
||||
if let Err(err) = callback(sp.clone()) {
|
||||
log::error!("Error of {} service: {}", sp.name(), err);
|
||||
if tm.elapsed() > time::Duration::from_millis(MAX_ERROR_TIMEOUT) {
|
||||
error_timeout = HIBERATE_TIMEOUT;
|
||||
error_timeout = HIBERNATE_TIMEOUT;
|
||||
} else {
|
||||
error_timeout *= 2;
|
||||
}
|
||||
@ -213,7 +213,7 @@ impl<T: Subscriber + From<ConnInner>> ServiceTmpl<T> {
|
||||
log::debug!("Exit {} service inner loop", sp.name());
|
||||
}
|
||||
}
|
||||
thread::sleep(time::Duration::from_millis(HIBERATE_TIMEOUT));
|
||||
thread::sleep(time::Duration::from_millis(HIBERNATE_TIMEOUT));
|
||||
}
|
||||
});
|
||||
self.0.write().unwrap().handle = Some(thread);
|
||||
|
Loading…
x
Reference in New Issue
Block a user