Adding breadcrumbs for debugging
build-linux / build-linux-x64 (push) Successful in 5m32s
build-macos / build-macos-x64 (push) Successful in 9m16s
build-windows / build-windows-x64 (push) Successful in 11m1s

This commit is contained in:
2026-05-06 22:12:31 +02:00
parent 359e09f7cd
commit d6c77d524a
3 changed files with 26 additions and 1 deletions
+8 -1
View File
@@ -384,10 +384,16 @@ pub fn core_main() -> Option<Vec<String>> {
hbb_common::allow_err!(crate::run_me(vec!["--tray"]));
}
#[cfg(windows)]
crate::privacy_mode::restore_reg_connectivity(true, false);
{
log::info!("breadcrumb: --server before restore_reg_connectivity");
crate::privacy_mode::restore_reg_connectivity(true, false);
log::info!("breadcrumb: --server after restore_reg_connectivity");
}
#[cfg(any(target_os = "linux", target_os = "windows"))]
{
log::info!("breadcrumb: --server before start_server(true, false)");
crate::start_server(true, false);
log::info!("breadcrumb: --server start_server returned (unexpected)");
}
#[cfg(target_os = "macos")]
{
@@ -396,6 +402,7 @@ pub fn core_main() -> Option<Vec<String>> {
// prevent server exit when encountering errors from tray
hbb_common::allow_err!(handler.join());
}
log::info!("breadcrumb: --server falling through to return None");
return None;
} else if args[0] == "--import-config" {
if args.len() == 2 {
+11
View File
@@ -58,19 +58,26 @@ impl RendezvousMediator {
}
pub async fn start_all() {
log::info!("breadcrumb: start_all enter");
crate::test_nat_type();
log::info!("breadcrumb: after test_nat_type");
if config::is_outgoing_only() {
log::info!("breadcrumb: outgoing_only sleep loop");
loop {
sleep(1.).await;
}
}
crate::hbbs_http::sync::start();
log::info!("breadcrumb: after hbbs_http::sync::start");
#[cfg(target_os = "windows")]
if crate::platform::is_installed() && crate::is_server() {
crate::updater::start_auto_update();
}
log::info!("breadcrumb: after updater check");
check_zombie();
log::info!("breadcrumb: after check_zombie");
let server = new_server();
log::info!("breadcrumb: after new_server");
if config::option2bool("stop-service", &Config::get_option("stop-service")) {
crate::test_rendezvous_server();
}
@@ -78,10 +85,12 @@ impl RendezvousMediator {
tokio::spawn(async move {
direct_server(server_cloned).await;
});
log::info!("breadcrumb: after direct_server spawn");
#[cfg(target_os = "android")]
let start_lan_listening = true;
#[cfg(not(any(target_os = "android", target_os = "ios")))]
let start_lan_listening = crate::platform::is_installed();
log::info!("breadcrumb: start_lan_listening={start_lan_listening}");
if start_lan_listening {
std::thread::spawn(move || {
allow_err!(super::lan::start_listening());
@@ -92,7 +101,9 @@ impl RendezvousMediator {
if crate::is_server() {
crate::platform::linux_desktop_manager::start_xdesktop();
}
log::info!("breadcrumb: before test_av1");
scrap::codec::test_av1();
log::info!("breadcrumb: after test_av1");
loop {
let timeout = Arc::new(RwLock::new(CONNECT_TIMEOUT));
let conn_start_time = Instant::now();
+7
View File
@@ -587,6 +587,7 @@ pub async fn start_server(is_server: bool, no_server: bool) {
});
if is_server {
log::info!("breadcrumb: start_server is_server=true enter");
crate::common::set_server_running(true);
std::thread::spawn(move || {
if let Err(err) = crate::ipc::start("") {
@@ -595,10 +596,13 @@ pub async fn start_server(is_server: bool, no_server: bool) {
log::error!("ipc is occupied by another process, try kill it");
std::thread::spawn(stop_main_window_process).join().ok();
}
log::error!("breadcrumb: about to std::process::exit(-1) from ipc::start failure");
std::process::exit(-1);
}
});
log::info!("breadcrumb: after ipc::start spawn");
input_service::fix_key_down_timeout_loop();
log::info!("breadcrumb: after fix_key_down_timeout_loop");
#[cfg(target_os = "linux")]
if input_service::wayland_use_uinput() {
allow_err!(input_service::setup_uinput(0, 1920, 0, 1080).await);
@@ -607,9 +611,12 @@ pub async fn start_server(is_server: bool, no_server: bool) {
wait_initial_config_sync().await;
#[cfg(target_os = "windows")]
crate::platform::try_kill_broker();
log::info!("breadcrumb: after try_kill_broker");
#[cfg(feature = "hwcodec")]
scrap::hwcodec::start_check_process();
log::info!("breadcrumb: after start_check_process, about to call start_all");
crate::RendezvousMediator::start_all().await;
log::info!("breadcrumb: start_all returned (unexpected)");
} else {
match crate::ipc::connect(1000, "").await {
Ok(mut conn) => {