mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-12-04 15:46:07 +00:00
Compare commits
3
Commits
master
...
sodium-init
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
333bfc6427 | ||
|
|
289f839646 | ||
|
|
3dd95ab73b |
No files matched your search
@@ -120,7 +120,16 @@ impl Drop for SimpleCallOnReturn {
|
||||
}
|
||||
}
|
||||
|
||||
/// `sodium_init()` chooses libsodium's implementations, so it runs before anything else uses the
|
||||
/// library: a later call swaps Poly1305 under a computation another thread is in the middle of.
|
||||
pub fn init_sodium() {
|
||||
if hbb_common::sodiumoxide::init().is_err() {
|
||||
log::error!("Failed to initialize libsodium");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn global_init() -> bool {
|
||||
init_sodium();
|
||||
#[cfg(all(target_os = "linux", feature = "drm"))]
|
||||
crate::platform::linux::dispatch_wayland_display_probe();
|
||||
#[cfg(target_os = "linux")]
|
||||
|
||||
@@ -41,6 +41,8 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
fn initialize(app_dir: &str, custom_client_config: &str) {
|
||||
// On mobile `global_init` below comes after the custom client's signature is verified.
|
||||
crate::common::init_sodium();
|
||||
flutter::async_tasks::start_flutter_async_runner();
|
||||
// `APP_DIR` is set in `main_get_data_dir_ios()` on iOS.
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
@@ -3087,6 +3089,8 @@ pub mod server_side {
|
||||
custom_client_config: JString,
|
||||
) {
|
||||
log::debug!("startServer from jvm");
|
||||
// Started at boot, the service runs without the Flutter side and its `initialize`.
|
||||
crate::common::init_sodium();
|
||||
let mut env = env;
|
||||
if let Ok(app_dir) = env.get_string(&app_dir) {
|
||||
*config::APP_DIR.write().unwrap() = app_dir.into();
|
||||
|
||||
Reference in new issue
Block a user