mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix on should_exit
This commit is contained in:
11
src/ipc.rs
11
src/ipc.rs
@@ -264,6 +264,7 @@ async fn handle(data: Data, stream: &mut Connection) {
|
||||
{
|
||||
RendezvousMediator::restart();
|
||||
}
|
||||
allow_err!(stream.send(&Data::Options(None)).await);
|
||||
}
|
||||
},
|
||||
Data::NatType(_) => {
|
||||
@@ -497,11 +498,11 @@ pub fn set_option(key: &str, value: &str) {
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
pub async fn set_options(value: HashMap<String, String>) -> ResultType<()> {
|
||||
Config::set_options(value.clone());
|
||||
connect(1000, "")
|
||||
.await?
|
||||
.send(&Data::Options(Some(value)))
|
||||
.await?;
|
||||
let mut c = connect(1000, "").await?;
|
||||
c.send(&Data::Options(Some(value.clone()))).await?;
|
||||
// do not put below before connect, because we need to check should_exit
|
||||
c.next_timeout(1000).await.ok();
|
||||
Config::set_options(value);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user