diff options
| -rw-r--r-- | mullvad-daemon/src/main.rs | 2 | ||||
| -rw-r--r-- | talpid-types/src/tunnel.rs | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/mullvad-daemon/src/main.rs b/mullvad-daemon/src/main.rs index b4b1f465a8..1bcdeb8dd2 100644 --- a/mullvad-daemon/src/main.rs +++ b/mullvad-daemon/src/main.rs @@ -593,7 +593,7 @@ impl Daemon { /// progress towards that state. /// Returns an error if trying to set secured state, but no account token is present. fn set_target_state(&mut self, new_state: TargetState) -> ::std::result::Result<(), ()> { - if new_state != self.target_state { + if new_state != self.target_state || self.tunnel_state.is_blocked() { debug!("Target state {:?} => {:?}", self.target_state, new_state); self.target_state = new_state; match self.target_state { diff --git a/talpid-types/src/tunnel.rs b/talpid-types/src/tunnel.rs index 1819919d5a..ab2b76ae96 100644 --- a/talpid-types/src/tunnel.rs +++ b/talpid-types/src/tunnel.rs @@ -17,6 +17,15 @@ pub enum TunnelStateTransition { Blocked(BlockReason), } +impl TunnelStateTransition { + pub fn is_blocked(&self) -> bool { + match self { + TunnelStateTransition::Blocked(_) => true, + _ => false, + } + } +} + /// Reason for entering the blocked state. #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] |
