This commit is contained in:
Jon Häggblad
2022-09-07 17:01:52 +02:00
parent 06ac21e21b
commit 73955ecfa3
5 changed files with 15 additions and 2 deletions
Generated
+2 -2
View File
@@ -2059,8 +2059,8 @@ dependencies = [
"thiserror",
"tokio",
"tokio-stream",
"tokio-tungstenite",
"tungstenite",
"tokio-tungstenite 0.14.0",
"tungstenite 0.13.0",
"url",
"validator-client",
"wasm-bindgen",
+4
View File
@@ -1,3 +1,5 @@
use std::sync::atomic::AtomicBool;
pub mod cover_traffic_stream;
pub mod inbound_messages;
pub mod key_manager;
@@ -6,3 +8,5 @@ pub mod real_messages_control;
pub mod received_buffer;
pub mod reply_key_storage;
pub mod topology_control;
pub static SHUTDOWN_IS_SIGNALLED: AtomicBool = AtomicBool::new(false);
@@ -316,6 +316,8 @@ impl TopologyRefresher {
},
}
}
let a = SHUTDOWN_IS_SIGNALED;
let a = crate::client::SHUTDOWN_IS_SIGNALLED.load(std::sync::atomic::Ordering::Relaxed);
log::debug!("TopologyRefresher: Exiting");
})
}
+6
View File
@@ -1,6 +1,8 @@
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use std::sync::atomic::AtomicBool;
use client_core::client::cover_traffic_stream::LoopCoverTrafficStream;
use client_core::client::inbound_messages::{
InputMessage, InputMessageReceiver, InputMessageSender,
@@ -39,6 +41,8 @@ use crate::socks::{
pub mod config;
pub static SHUTDOWN_IS_SIGNALLED: AtomicBool = AtomicBool::new(false);
// Channels used to control the main task from outside
pub type Socks5ControlMessageSender = mpsc::UnboundedSender<Socks5ControlMessage>;
pub type Socks5ControlMessageReceiver = mpsc::UnboundedReceiver<Socks5ControlMessage>;
@@ -290,6 +294,8 @@ impl NymClient {
wait_for_signal().await;
log::info!("Sending shutdown");
SHUTDOWN_IS_SIGNALLED.store(true, std::sync::atomic::Ordering::Relaxed);
client_core::client::SHUTDOWN_IS_SIGNALLED.store(true, std::sync::atomic::Ordering::Relaxed);
shutdown.signal_shutdown().ok();
log::info!("Waiting for tasks to finish... (Press ctrl-c to force)");
@@ -89,6 +89,7 @@ impl MixnetResponseListener {
}
}
}
let a = crate::client::SHUTDOWN_IS_SIGNALLED.load(std::sync::atomic::Ordering::Relaxed);
log::debug!("MixnetResponseListener: Exiting");
}
}