mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-27 07:01:00 +03:00
--no-server parameter to avoid server ipc occupied by ui (#9272)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -39,6 +39,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
let mut _is_run_as_system = false;
|
||||
let mut _is_quick_support = false;
|
||||
let mut _is_flutter_invoke_new_connection = false;
|
||||
let mut no_server = false;
|
||||
let mut arg_exe = Default::default();
|
||||
for arg in std::env::args() {
|
||||
if i == 0 {
|
||||
@@ -62,6 +63,8 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
_is_run_as_system = true;
|
||||
} else if arg == "--quick_support" {
|
||||
_is_quick_support = true;
|
||||
} else if arg == "--no-server" {
|
||||
no_server = true;
|
||||
} else {
|
||||
args.push(arg);
|
||||
}
|
||||
@@ -134,6 +137,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
}
|
||||
}
|
||||
hbb_common::init_log(false, &log_name);
|
||||
log::info!("main start args: {:?}, env: {:?}", args, std::env::args());
|
||||
|
||||
// linux uni (url) go here.
|
||||
#[cfg(all(target_os = "linux", feature = "flutter"))]
|
||||
@@ -161,9 +165,8 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
init_plugins(&args);
|
||||
log::info!("main start args:{:?}", args);
|
||||
if args.is_empty() || crate::common::is_empty_uni_link(&args[0]) {
|
||||
std::thread::spawn(move || crate::start_server(false));
|
||||
std::thread::spawn(move || crate::start_server(false, no_server));
|
||||
} else {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
@@ -279,11 +282,11 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
crate::privacy_mode::restore_reg_connectivity(true);
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
{
|
||||
crate::start_server(true);
|
||||
crate::start_server(true, false);
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let handler = std::thread::spawn(move || crate::start_server(true));
|
||||
let handler = std::thread::spawn(move || crate::start_server(true, false));
|
||||
crate::tray::start_tray();
|
||||
// prevent server exit when encountering errors from tray
|
||||
hbb_common::allow_err!(handler.join());
|
||||
|
||||
Reference in New Issue
Block a user