diff options
author | rustdesk <[email protected]> | 2023-06-08 13:42:34 +0800 |
---|---|---|
committer | rustdesk <[email protected]> | 2023-06-08 13:42:34 +0800 |
commit | 3a7904fa8e325636a85b4cc941b3d598c9651a7f (patch) | |
tree | 6ce9c49300ee1080e9175f8b908de658293cb09b | |
parent | 482d7fb8ccaf671170f5a8fa93af2d91b27d583f (diff) | |
download | rustdesk-server-3a7904fa8e325636a85b4cc941b3d598c9651a7f.tar.gz rustdesk-server-3a7904fa8e325636a85b4cc941b3d598c9651a7f.zip |
fix test_hbb and bump version 1.1.8
-rw-r--r-- | Cargo.lock | 129 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | db_v2.sqlite3 | bin | 24576 -> 24576 bytes | |||
-rw-r--r-- | libs/hbb_common/src/config.rs | 5 | ||||
-rw-r--r-- | src/rendezvous_server.rs | 19 |
5 files changed, 103 insertions, 52 deletions
@@ -277,12 +277,6 @@ dependencies = [ ] [[package]] -name = "const-sha1" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" - -[[package]] name = "core-foundation" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -785,7 +779,7 @@ dependencies = [ [[package]] name = "hbbs" -version = "1.1.7-1" +version = "1.1.8" dependencies = [ "async-speed-limit", "async-trait", @@ -1086,15 +1080,14 @@ dependencies = [ [[package]] name = "local-ip-address" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b143c6ef86e36328caa40a7578e95d1544aca8a1740235fd2b416a69441a5c7" +checksum = "2815836665de176ba66deaa449ada98fdf208d84730d1a84a22cbeed6151a6fa" dependencies = [ "libc", - "memalloc", "neli", "thiserror", - "windows", + "windows-sys 0.48.0", ] [[package]] @@ -1148,12 +1141,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" [[package]] -name = "memalloc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" - -[[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1222,7 +1209,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1236,12 +1223,27 @@ dependencies = [ [[package]] name = "neli" -version = "0.5.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9053554eb5dcb7e10d9cdab1206965bde870eed5d0d341532ca035e3ba221508" +checksum = "1100229e06604150b3becd61a4965d5c70f3be1759544ea7274166f4be41ef43" dependencies = [ "byteorder", "libc", + "log", + "neli-proc-macros", +] + +[[package]] +name = "neli-proc-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168194d373b1e134786274020dae7fc5513d565ea2ebb9bc9ff17ffb69106d4" +dependencies = [ + "either", + "proc-macro2", + "quote", + "serde", + "syn", ] [[package]] @@ -1403,7 +1405,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2730,40 +2732,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.18.0" +name = "windows-sys" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68088239696c06152844eadc03d262f088932cce50c67e4ace86e19d95e976fe" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "const-sha1", - "windows_gen", - "windows_macros", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows-targets", ] [[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] -name = "windows_gen" -version = "0.18.0" +name = "windows_aarch64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf583322dc423ee021035b358e535015f7fd163058a31e2d37b99a939141121d" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" @@ -2772,20 +2793,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] -name = "windows_macros" -version = "0.18.0" +name = "windows_i686_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58acfb8832e9f707f8997bd161e537a1c1f603e60a5bd9c3cf53484fdcc998f3" -dependencies = [ - "syn", - "windows_gen", -] +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" @@ -2794,12 +2817,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] name = "winreg" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1,6 +1,6 @@ [package] name = "hbbs" -version = "1.1.7-1" +version = "1.1.8" authors = ["rustdesk <[email protected]>"] edition = "2021" build = "build.rs" diff --git a/db_v2.sqlite3 b/db_v2.sqlite3 Binary files differindex c95a2f3..b77c79f 100644 --- a/db_v2.sqlite3 +++ b/db_v2.sqlite3 diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index 3bfc885..099a454 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -337,14 +337,13 @@ impl Config2 { pub fn load_path<T: serde::Serialize + serde::de::DeserializeOwned + Default + std::fmt::Debug>( file: PathBuf, ) -> T { - let cfg = match confy::load_path(file) { + match confy::load_path(file) { Ok(config) => config, Err(err) => { log::error!("Failed to load config: {}", err); T::default() } - }; - cfg + } } #[inline] diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index 88cd6cb..681ffe6 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -1,7 +1,7 @@ use crate::common::*; use crate::peer::*; use hbb_common::{ - allow_err, + allow_err, bail, bytes::{Bytes, BytesMut}, bytes_codec::BytesCodec, config, @@ -166,7 +166,10 @@ impl RendezvousServer { test_addr.parse()? }; tokio::spawn(async move { - allow_err!(test_hbbs(test_addr).await); + if let Err(err) = test_hbbs(test_addr).await { + log::error!("Failed to run hbbs test with {test_addr}: {err}"); + std::process::exit(1); + } }); }; let main_task = async move { @@ -1225,6 +1228,15 @@ async fn check_relay_servers(rs0: Arc<RelayServers>, tx: Sender) { // temp solution to solve udp socket failure async fn test_hbbs(addr: SocketAddr) -> ResultType<()> { + let mut addr = addr; + if addr.ip().is_unspecified() { + addr.set_ip(if addr.is_ipv4() { + IpAddr::V4(Ipv4Addr::LOCALHOST) + } else { + IpAddr::V6(Ipv6Addr::LOCALHOST) + }); + } + let mut socket = FramedSocket::new(config::Config::get_any_listen_addr(addr.is_ipv4())).await?; let mut msg_out = RendezvousMessage::new(); msg_out.set_register_peer(RegisterPeer { @@ -1238,8 +1250,7 @@ async fn test_hbbs(addr: SocketAddr) -> ResultType<()> { tokio::select! { _ = timer.tick() => { if last_time_recv.elapsed().as_secs() > 12 { - log::error!("Timeout of test_hbbs"); - std::process::exit(1); + bail!("Timeout of test_hbbs"); } socket.send(&msg_out, addr).await?; } |