Skip to content

Commit b39ba92

Browse files
authored
Merge pull request rustdesk#6018 from 21pages/sync_share_rdp
sync option share rdp
2 parents deb1c19 + 5d0384f commit b39ba92

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Diff for: src/hbbs_http/sync.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,22 @@ fn handle_config_options(config_options: HashMap<String, String>) {
147147
config_options
148148
.iter()
149149
.map(|(k, v)| {
150-
if v.is_empty() {
151-
options.remove(k);
150+
if k == "allow-share-rdp" {
151+
// only changes made after installation take effect.
152+
#[cfg(windows)]
153+
if crate::ui_interface::is_rdp_service_open() {
154+
let current = crate::ui_interface::is_share_rdp();
155+
let set = v == "Y";
156+
if current != set {
157+
crate::platform::windows::set_share_rdp(set);
158+
}
159+
}
152160
} else {
153-
options.insert(k.to_string(), v.to_string());
161+
if v.is_empty() {
162+
options.remove(k);
163+
} else {
164+
options.insert(k.to_string(), v.to_string());
165+
}
154166
}
155167
})
156168
.count();

0 commit comments

Comments
 (0)