From 2cab09d30b74fdbd7a92d721624a348602674879 Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Wed, 4 Nov 2020 00:09:02 +0100 Subject: [PATCH] Downgrade tokio because some crates aren't ready Problematic crates include - actix-codec > ... > actix-web - actix-rt > ... > actix-web - async-minecraft-ping - dbus-tokio - h2 > ... > actix-web - trust-dns-proto > ... > actix-web - trust-dns-resolver > ... > actix-web --- sfsmcctl/Cargo.toml | 2 +- sfsmcd/Cargo.toml | 2 +- sfsmcd/src/main.rs | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sfsmcctl/Cargo.toml b/sfsmcctl/Cargo.toml index 055be27..413ec74 100644 --- a/sfsmcctl/Cargo.toml +++ b/sfsmcctl/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] clap = { version = "2.33", features = ["wrap_help", "color"] } toml = "0.5" -tokio = { version = "0.3", features = ["full"] } +tokio = { version = "0.2", features = ["full"] } async-minecraft-ping = "0.2" dbus = { version = "0.9", features = ["futures"] } dbus-tokio = "0.6" diff --git a/sfsmcd/Cargo.toml b/sfsmcd/Cargo.toml index 7c40c0b..aa6f382 100644 --- a/sfsmcd/Cargo.toml +++ b/sfsmcd/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] actix-web = "3.2" toml = "0.5" -tokio = { version = "0.3", features = ["full"] } +tokio = { version = "0.2", features = ["full"] } async-minecraft-ping = "0.2" dbus = { version = "0.9", features = ["futures"] } dbus-tokio = "0.6" diff --git a/sfsmcd/src/main.rs b/sfsmcd/src/main.rs index 7a470ab..52cb987 100644 --- a/sfsmcd/src/main.rs +++ b/sfsmcd/src/main.rs @@ -19,10 +19,12 @@ fn iface_name(iface: &str) -> String { DBUS_NAME.to_owned() + "." + iface } -fn iface_rt() -> Arc { +// fn iface_rt() -> Arc { +fn iface_rt() -> tokio::runtime::Handle { IFACE_RT_INIT.call_once(|| { unsafe { - IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new_multi_thread() + // IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new_multi_thread() + IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new() .thread_name("iface-runtime-worker") .build() .unwrap() @@ -31,7 +33,8 @@ fn iface_rt() -> Arc { }); unsafe { - IFACE_RT.clone().unwrap() + // IFACE_RT.clone().unwrap() + IFACE_RT.clone().map(|x| x.handle().clone()).unwrap() } }