This commit is contained in:
rustdesk
2022-02-28 12:36:32 +08:00
parent 9cc3cf92ab
commit 8648c70df4
3 changed files with 4 additions and 10 deletions

View File

@@ -263,12 +263,16 @@ async fn handle(data: Data, stream: &mut Connection) {
Some(value) => {
let v0 = Config::get_option("stop-service");
let v1 = Config::get_rendezvous_servers();
let v2 = Config::get_option("audio-input");
Config::set_options(value);
if v0 != Config::get_option("stop-service")
|| v1 != Config::get_rendezvous_servers()
{
RendezvousMediator::restart();
}
if v2 != Config::get_option("audio-input") {
crate::audio_service::restart();
}
allow_err!(stream.send(&Data::Options(None)).await);
}
},
@@ -515,10 +519,6 @@ pub fn set_option(key: &str, value: &str) {
set_options(options).ok();
}
pub fn restart_autdio_service() {
crate::audio_service::restart();
}
#[tokio::main(flavor = "current_thread")]
pub async fn set_options(value: HashMap<String, String>) -> ResultType<()> {
let mut c = connect(1000, "").await?;