@@ -76,9 +76,9 @@ use std::{
76
76
sync:: { Arc , Weak } ,
77
77
time:: Duration ,
78
78
} ;
79
- use talpid_core:: split_tunnel;
80
79
use talpid_core:: {
81
80
mpsc:: Sender ,
81
+ split_tunnel,
82
82
tunnel_state_machine:: { self , TunnelCommand , TunnelStateMachineHandle } ,
83
83
} ;
84
84
#[ cfg( target_os = "android" ) ]
@@ -352,7 +352,7 @@ pub enum DaemonCommand {
352
352
SetObfuscationSettings ( ResponseTx < ( ) , settings:: Error > , ObfuscationSettings ) ,
353
353
/// Saves the target tunnel state and enters a blocking state. The state is restored
354
354
/// upon restart.
355
- PrepareRestart ,
355
+ PrepareRestart ( bool ) ,
356
356
/// Causes a socket to bypass the tunnel. This has no effect when connected. It is only used
357
357
/// to bypass the tunnel in blocking states.
358
358
#[ cfg( target_os = "android" ) ]
@@ -1290,9 +1290,7 @@ where
1290
1290
SetObfuscationSettings ( tx, settings) => {
1291
1291
self . on_set_obfuscation_settings ( tx, settings) . await
1292
1292
}
1293
- PrepareRestart => {
1294
- self . on_prepare_restart ( true /*TODO: This should be passed down!*/ )
1295
- }
1293
+ PrepareRestart ( shutdown) => self . on_prepare_restart ( shutdown) ,
1296
1294
#[ cfg( target_os = "android" ) ]
1297
1295
BypassSocket ( fd, tx) => self . on_bypass_socket ( fd, tx) ,
1298
1296
#[ cfg( target_os = "android" ) ]
@@ -2702,7 +2700,8 @@ where
2702
2700
2703
2701
/// Prepare the daemon for a restart by setting the target state to [`TargetState::Secured`].
2704
2702
///
2705
- /// - `shutdown`: If the daemon should shut down itself when .. TODO
2703
+ /// - `shutdown`: If the daemon should shut down itself when after setting the secured target
2704
+ /// state. set to `false` if the intention is to close the daemon process manually.
2706
2705
fn on_prepare_restart ( & mut self , shutdown : bool ) {
2707
2706
// TODO: See if this can be made to also shut down the daemon
2708
2707
// without causing the service to be restarted.
0 commit comments