diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-06-27 19:27:03 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-06-30 15:58:40 +0200 |
| commit | df6c8a8a60a7fbbb971c02c8a5483430b1db029e (patch) | |
| tree | 8bbc20100313c2582c4a67a9623954fc777209c6 /mullvad_daemon/src | |
| parent | ba1ed122e8f1e2ad19c3dfb6f40696bfa2d57fd1 (diff) | |
| download | mullvadvpn-df6c8a8a60a7fbbb971c02c8a5483430b1db029e.tar.xz mullvadvpn-df6c8a8a60a7fbbb971c02c8a5483430b1db029e.zip | |
Write credentials to file for user-pass auth
Diffstat (limited to 'mullvad_daemon/src')
| -rw-r--r-- | mullvad_daemon/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mullvad_daemon/src/main.rs b/mullvad_daemon/src/main.rs index 53faed7f6f..2ac5922bee 100644 --- a/mullvad_daemon/src/main.rs +++ b/mullvad_daemon/src/main.rs @@ -228,7 +228,7 @@ impl Daemon { if let Err(_) = tx.send(self.last_broadcasted_state) { warn!("Unable to send current state to management interface client",); } - }, + } TunnelCommand::SetAccount(account_token) => self.account_token = account_token, } Ok(()) @@ -310,7 +310,7 @@ impl Daemon { ErrorKind::InvalidState ); let remote = self.remote_iter.next().unwrap(); - let tunnel_monitor = self.spawn_tunnel_monitor(remote)?; + let tunnel_monitor = self.spawn_tunnel_monitor(remote, self.account_token.as_str())?; self.tunnel_close_handle = Some(tunnel_monitor.close_handle()); self.spawn_tunnel_monitor_wait_thread(tunnel_monitor); @@ -318,13 +318,13 @@ impl Daemon { Ok(()) } - fn spawn_tunnel_monitor(&self, remote: Endpoint) -> Result<TunnelMonitor> { + fn spawn_tunnel_monitor(&self, remote: Endpoint, account_token: &str) -> Result<TunnelMonitor> { // Must wrap the channel in a Mutex because TunnelMonitor forces the closure to be Sync let event_tx = Arc::new(Mutex::new(self.tx.clone())); let on_tunnel_event = move |event| { let _ = event_tx.lock().unwrap().send(DaemonEvent::TunnelEvent(event)); }; - TunnelMonitor::new(remote, on_tunnel_event) + TunnelMonitor::new(remote, account_token, on_tunnel_event) .chain_err(|| ErrorKind::TunnelError("Unable to start tunnel monitor")) } |
