diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-09-01 08:30:25 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-09-01 08:30:25 +0200 |
| commit | 6cc0c78b5e91de148d2955db572e5ec8fc863e4a (patch) | |
| tree | a7b0f0a631eb959a1c39f009918ea923e197f43d /mullvad-daemon/src | |
| parent | 564ff48c50e1d1c8a6f8b10036a04590ace54659 (diff) | |
| parent | ac6e75327750b1380c994074caa335ef692fa216 (diff) | |
| download | mullvadvpn-6cc0c78b5e91de148d2955db572e5ec8fc863e4a.tar.xz mullvadvpn-6cc0c78b5e91de148d2955db572e5ec8fc863e4a.zip | |
Merge branch 'upgrade-jsonrpc-client'
Diffstat (limited to 'mullvad-daemon/src')
| -rw-r--r-- | mullvad-daemon/src/main.rs | 6 | ||||
| -rw-r--r-- | mullvad-daemon/src/master.rs | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/mullvad-daemon/src/main.rs b/mullvad-daemon/src/main.rs index 112fe26b82..4551b19b7f 100644 --- a/mullvad-daemon/src/main.rs +++ b/mullvad-daemon/src/main.rs @@ -37,7 +37,7 @@ mod shutdown; use error_chain::ChainedError; use futures::{BoxFuture, Future}; -use jsonrpc_client_http::{Error as HttpError, HttpHandle}; +use jsonrpc_client_http::HttpHandle; use jsonrpc_core::futures::sync::oneshot::Sender as OneshotSender; use management_interface::{ManagementInterfaceServer, TunnelCommand}; use master::AccountsProxy; @@ -160,7 +160,7 @@ struct Daemon { tx: mpsc::Sender<DaemonEvent>, management_interface_broadcaster: management_interface::EventBroadcaster, settings: settings::Settings, - accounts_proxy: AccountsProxy<HttpError, HttpHandle>, + accounts_proxy: AccountsProxy<HttpHandle>, firewall: FirewallProxy, remote_endpoint: Option<Endpoint>, tunnel_interface: Option<String>, @@ -191,7 +191,7 @@ impl Daemon { management_interface_broadcaster, settings: settings::Settings::load().chain_err(|| "Unable to read settings")?, accounts_proxy: master::create_account_proxy() - .chain_err(|| "Unable to connect to master")?, + .chain_err(|| "Unable to bootstrap RPC client")?, firewall: FirewallProxy::new().chain_err(|| ErrorKind::FirewallError)?, remote_endpoint: None, tunnel_interface: None, diff --git a/mullvad-daemon/src/master.rs b/mullvad-daemon/src/master.rs index 96bf4778f2..37bfbe65e5 100644 --- a/mullvad-daemon/src/master.rs +++ b/mullvad-daemon/src/master.rs @@ -1,14 +1,13 @@ use chrono::DateTime; use chrono::offset::Utc; -use jsonrpc_client_http::{Error as HttpError, HttpCore, HttpHandle}; +use jsonrpc_client_http::{Error as HttpError, HttpHandle, HttpTransport}; use mullvad_types::account::AccountToken; static MASTER_API_URI: &str = "https://api.mullvad.net/rpc/"; -pub fn create_account_proxy() -> Result<AccountsProxy<HttpError, HttpHandle>, HttpError> { - let core = HttpCore::standalone()?; - let transport = core.handle(MASTER_API_URI)?; +pub fn create_account_proxy() -> Result<AccountsProxy<HttpHandle>, HttpError> { + let transport = HttpTransport::new()?.handle(MASTER_API_URI)?; Ok(AccountsProxy::new(transport)) } |
