summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-07-12 11:46:53 +0200
committerDavid Lönnhager <david.l@mullvad.net>2021-07-13 15:57:41 +0200
commit2330d73ee85b246547d81180bec794e9c5ed0852 (patch)
tree51cfa0d39d7dd2df6cb33e3b84aac88d87e51a69
parentef2a4d8616274996cd6b5620e890ce8a3f507986 (diff)
downloadmullvadvpn-2330d73ee85b246547d81180bec794e9c5ed0852.tar.xz
mullvadvpn-2330d73ee85b246547d81180bec794e9c5ed0852.zip
Update the route manager for macOS
-rw-r--r--Cargo.lock1
-rw-r--r--mullvad-rpc/Cargo.toml3
-rw-r--r--talpid-core/src/routing/macos.rs3
3 files changed, 6 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 08fadfd433..b6207ef990 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1421,6 +1421,7 @@ dependencies = [
"tempfile",
"tokio",
"tokio-rustls",
+ "tokio-stream",
"urlencoding",
"webpki",
]
diff --git a/mullvad-rpc/Cargo.toml b/mullvad-rpc/Cargo.toml
index 4987afca70..089ae45ae0 100644
--- a/mullvad-rpc/Cargo.toml
+++ b/mullvad-rpc/Cargo.toml
@@ -36,6 +36,9 @@ tempfile = "3.0"
[target.'cfg(target_os="android")'.dependencies]
socket2 = "0.3"
+[target.'cfg(target_os="macos")'.dependencies]
+tokio-stream = { version = "0.1", features = ["io-util"] }
+
[[bin]]
name = "relay_list"
diff --git a/talpid-core/src/routing/macos.rs b/talpid-core/src/routing/macos.rs
index e15899c551..6808ad3e7b 100644
--- a/talpid-core/src/routing/macos.rs
+++ b/talpid-core/src/routing/macos.rs
@@ -13,6 +13,7 @@ use std::{
process::{ExitStatus, Stdio},
};
use tokio::{io::AsyncBufReadExt, process::Command};
+use tokio_stream::wrappers::LinesStream;
pub type Result<T> = std::result::Result<T, Error>;
@@ -332,7 +333,7 @@ async fn listen_for_default_route_changes() -> Result<impl Stream<Item = std::io
let mut add_or_delete_message = false;
let mut contains_default = false;
- let monitor = lines.try_filter_map(move |line| {
+ let monitor = LinesStream::new(lines).try_filter_map(move |line| {
if add_or_delete_message {
if line.contains("default") {
contains_default = true;