summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon
diff options
context:
space:
mode:
Diffstat (limited to 'mullvad-daemon')
-rw-r--r--mullvad-daemon/src/macos_launch_daemon.rs2
-rw-r--r--mullvad-daemon/src/migrations/v10.rs2
-rw-r--r--mullvad-daemon/src/relay_list/mod.rs19
3 files changed, 14 insertions, 9 deletions
diff --git a/mullvad-daemon/src/macos_launch_daemon.rs b/mullvad-daemon/src/macos_launch_daemon.rs
index 4b7a6c5efa..df82983797 100644
--- a/mullvad-daemon/src/macos_launch_daemon.rs
+++ b/mullvad-daemon/src/macos_launch_daemon.rs
@@ -15,7 +15,7 @@ type Id = *mut AnyObject;
// Framework that contains `SMAppService`.
#[link(name = "ServiceManagement", kind = "framework")]
-extern "C" {}
+unsafe extern "C" {}
/// Returned by `[NSProcessInfo operatingSystemVersion]`. Contains the current
#[repr(C)]
diff --git a/mullvad-daemon/src/migrations/v10.rs b/mullvad-daemon/src/migrations/v10.rs
index 2b713b97ab..6fba7d9d5d 100644
--- a/mullvad-daemon/src/migrations/v10.rs
+++ b/mullvad-daemon/src/migrations/v10.rs
@@ -62,7 +62,7 @@ fn migrate_tunnel_type_inner(normal: &mut serde_json::Value) -> Result<()> {
}
// Migrate '"only": { "tunnel_protocol": $tunnel_protocol }'
// to '"tunnel_protocol": $tunnel_protocol'
- Some(serde_json::Value::Object(ref mut constraint)) => {
+ Some(serde_json::Value::Object(constraint)) => {
if let Some(tunnel_type) = constraint.get("only") {
let tunnel_type: TunnelType = serde_json::from_value(tunnel_type.clone())
.map_err(|_| Error::InvalidSettingsContent)?;
diff --git a/mullvad-daemon/src/relay_list/mod.rs b/mullvad-daemon/src/relay_list/mod.rs
index ee5781aff0..a508226807 100644
--- a/mullvad-daemon/src/relay_list/mod.rs
+++ b/mullvad-daemon/src/relay_list/mod.rs
@@ -167,14 +167,19 @@ impl RelayListUpdater {
proxy: RelayListProxy,
tag: Option<String>,
) -> impl Future<Output = Result<Option<RelayList>, mullvad_api::Error>> + use<> {
- let download_futures = move || {
+ async fn download_future(
+ api_handle: ApiAvailability,
+ proxy: RelayListProxy,
+ tag: Option<String>,
+ ) -> Result<Option<RelayList>, mullvad_api::Error> {
let available = api_handle.wait_background();
- let req = proxy.relay_list(tag.clone());
- async move {
- available.await?;
- req.await.map_err(mullvad_api::Error::from)
- }
- };
+ let req = proxy.relay_list(tag);
+ available.await?;
+ req.await.map_err(mullvad_api::Error::from)
+ }
+
+ let download_futures =
+ move || download_future(api_handle.clone(), proxy.clone(), tag.clone());
retry_future(
download_futures,