make sure no gen_keypair more than once

This commit is contained in:
csf
2022-07-29 16:30:55 +08:00
parent da2906c95f
commit 2fbcbc6543
3 changed files with 16 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ use crate::mobile::connection_manager::{self, get_clients_length, get_clients_st
use crate::mobile::{self, Session};
use crate::common::{make_fd_to_json};
use flutter_rust_bridge::{StreamSink, ZeroCopyBuffer};
use hbb_common::ResultType;
use hbb_common::{ResultType, init_uuid};
use hbb_common::{
config::{self, Config, LocalConfig, PeerConfig, ONLINE},
fs, log,
@@ -16,7 +16,6 @@ use std::{
};
fn initialize(app_dir: &str) {
*config::APP_DIR.write().unwrap() = app_dir.to_owned();
#[cfg(target_os = "android")]
{
android_logger::init_once(
@@ -30,6 +29,8 @@ fn initialize(app_dir: &str) {
use hbb_common::env_logger::*;
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "debug"));
}
*config::APP_DIR.write().unwrap() = app_dir.to_owned();
init_uuid();
crate::common::test_rendezvous_server();
crate::common::test_nat_type();
#[cfg(target_os = "android")]