summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mullvad-api/src/rest.rs7
-rw-r--r--mullvad-daemon/src/lib.rs3
2 files changed, 10 insertions, 0 deletions
diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs
index 4297bd92ed..517e0b3a03 100644
--- a/mullvad-api/src/rest.rs
+++ b/mullvad-api/src/rest.rs
@@ -256,6 +256,13 @@ impl RequestServiceHandle {
.map_err(|_| Error::SendError)?;
completion_rx.await.map_err(|_| Error::ReceiveError)?
}
+
+ /// Forcibly update the connection mode.
+ pub async fn next_api_endpoint(&self) -> Result<()> {
+ self.tx
+ .unbounded_send(RequestCommand::NextApiConfig)
+ .map_err(|_| Error::SendError)
+ }
}
#[derive(Debug)]
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs
index b98c6b5321..106f3c1784 100644
--- a/mullvad-daemon/src/lib.rs
+++ b/mullvad-daemon/src/lib.rs
@@ -2138,6 +2138,9 @@ where
.notify_settings(self.settings.to_settings());
self.relay_selector
.set_config(new_selector_config(&self.settings));
+ if let Err(error) = self.api_handle.service().next_api_endpoint().await {
+ log::error!("Failed to rotate API endpoint: {}", error);
+ }
self.reconnect_tunnel();
};
Self::oneshot_send(tx, Ok(()), "set_bridge_settings");