mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
Bugfix/wifi race conditions (#831)
* puts wifi manager behind mutex * remove commented code * use rwlocks instead of mutexes to allow for better interlocking
This commit is contained in:
committed by
Aiden McClelland
parent
2d2d390ff0
commit
13c227399b
@@ -26,6 +26,7 @@ use crate::install::cleanup::{cleanup_failed, uninstall};
|
||||
use crate::manager::ManagerMap;
|
||||
use crate::middleware::auth::HashSessionToken;
|
||||
use crate::net::tor::os_key;
|
||||
use crate::net::wifi::WpaCli;
|
||||
use crate::net::NetController;
|
||||
use crate::notifications::NotificationManager;
|
||||
use crate::shutdown::Shutdown;
|
||||
@@ -127,6 +128,7 @@ pub struct RpcContextSeed {
|
||||
pub notification_manager: NotificationManager,
|
||||
pub open_authed_websockets: Mutex<BTreeMap<HashSessionToken, Vec<oneshot::Sender<()>>>>,
|
||||
pub rpc_stream_continuations: Mutex<BTreeMap<RequestGuid, RpcContinuation>>,
|
||||
pub wifi_manager: Arc<RwLock<WpaCli>>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -194,6 +196,10 @@ impl RpcContext {
|
||||
notification_manager,
|
||||
open_authed_websockets: Mutex::new(BTreeMap::new()),
|
||||
rpc_stream_continuations: Mutex::new(BTreeMap::new()),
|
||||
wifi_manager: Arc::new(RwLock::new(WpaCli::init(
|
||||
"wlan0".to_string(),
|
||||
base.datadir().join("main"),
|
||||
))),
|
||||
});
|
||||
let metrics_seed = seed.clone();
|
||||
tokio::spawn(async move {
|
||||
|
||||
Reference in New Issue
Block a user