summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-04-27 17:01:30 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-08-23 15:00:04 -0300
commit3a4eb622b8893ff5bc415573ebeae7f3b0677932 (patch)
tree76cbaf6d679689d113a1f4df8798fc638b2e8c79
parent5abf70718d7386559fcbf7310eab764124d0ed61 (diff)
downloadmullvadvpn-3a4eb622b8893ff5bc415573ebeae7f3b0677932.tar.xz
mullvadvpn-3a4eb622b8893ff5bc415573ebeae7f3b0677932.zip
Refactor handling closed channels
When a channel is closed by the sender, any future `recv` calls to the receiver drains the internal buffer and afterwards always immediately returns `None`. Change the event handling code in each state taking into account what should be done when the respective sender of the channel gets closed.
-rw-r--r--mullvad-daemon/src/tunnel_state_machine/connecting_state.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/mullvad-daemon/src/tunnel_state_machine/connecting_state.rs b/mullvad-daemon/src/tunnel_state_machine/connecting_state.rs
index e909a786f3..f157163e7a 100644
--- a/mullvad-daemon/src/tunnel_state_machine/connecting_state.rs
+++ b/mullvad-daemon/src/tunnel_state_machine/connecting_state.rs
@@ -174,7 +174,7 @@ impl ConnectingState {
Err(_) => NewState(DisconnectingState::enter((
self.close_handle,
self.tunnel_close_event,
- AfterDisconnect::Nothing,
+ AfterDisconnect::Reconnect(self.tunnel_parameters),
))),
}
}