summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-09-07 14:35:24 +0200
committerErik Larkö <erik@mullvad.net>2017-09-13 07:32:26 +0200
commit8deee54dc8159ed4fb1905401529bbfeafb94db3 (patch)
tree6ae58c12c321d3fdeda76afc05a24d4804f7690c /mullvad-daemon/src
parentfe619d9db7b891b9c92a327ccac6e3913261fca2 (diff)
downloadmullvadvpn-8deee54dc8159ed4fb1905401529bbfeafb94db3.tar.xz
mullvadvpn-8deee54dc8159ed4fb1905401529bbfeafb94db3.zip
Create talpid-types and put TransportProtocol there
Diffstat (limited to 'mullvad-daemon/src')
-rw-r--r--mullvad-daemon/src/main.rs22
1 files changed, 9 insertions, 13 deletions
diff --git a/mullvad-daemon/src/main.rs b/mullvad-daemon/src/main.rs
index 17b6df06d5..d548eb3e03 100644
--- a/mullvad-daemon/src/main.rs
+++ b/mullvad-daemon/src/main.rs
@@ -35,6 +35,7 @@ extern crate lazy_static;
extern crate mullvad_types;
extern crate talpid_core;
extern crate talpid_ipc;
+extern crate talpid_types;
mod cli;
mod management_interface;
@@ -57,14 +58,13 @@ use mullvad_types::states::{DaemonState, SecurityState, TargetState};
use std::io;
use std::net::{Ipv4Addr, SocketAddr, ToSocketAddrs};
use std::path::PathBuf;
-use std::str::FromStr;
use std::sync::{Arc, Mutex, mpsc};
use std::thread;
use talpid_core::firewall::{Firewall, FirewallProxy, SecurityPolicy};
use talpid_core::mpsc::IntoSender;
-use talpid_core::net::{Endpoint, TransportProtocol};
use talpid_core::tunnel::{self, TunnelEvent, TunnelMonitor};
+use talpid_types::net::{Endpoint, TransportProtocol};
error_chain!{
errors {
@@ -544,17 +544,13 @@ impl Daemon {
)
}
- let protocol = TransportProtocol::from_str(&relay_endpoint.protocol)
- .map_err(
- |_| {
- format!(
- "Invalid custom server protocol: {}",
- relay_endpoint.protocol
- )
- },
- )?;
-
- Ok(Endpoint::new(socket_addr.ip(), socket_addr.port(), protocol),)
+ Ok(
+ Endpoint::new(
+ socket_addr.ip(),
+ socket_addr.port(),
+ relay_endpoint.protocol,
+ ),
+ )
}
}