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 | |
| parent | 564ff48c50e1d1c8a6f8b10036a04590ace54659 (diff) | |
| parent | ac6e75327750b1380c994074caa335ef692fa216 (diff) | |
| download | mullvadvpn-6cc0c78b5e91de148d2955db572e5ec8fc863e4a.tar.xz mullvadvpn-6cc0c78b5e91de148d2955db572e5ec8fc863e4a.zip | |
Merge branch 'upgrade-jsonrpc-client'
| -rw-r--r-- | Cargo.lock | 49 | ||||
| -rw-r--r-- | mullvad-daemon/Cargo.toml | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/main.rs | 6 | ||||
| -rw-r--r-- | mullvad-daemon/src/master.rs | 7 |
4 files changed, 33 insertions, 33 deletions
diff --git a/Cargo.lock b/Cargo.lock index a1d5e77fc3..4e2225747f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -323,7 +323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -331,7 +331,7 @@ name = "futures-cpupool" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -369,7 +369,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -389,7 +389,7 @@ name = "hyper-tls" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -434,11 +434,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-client-core" -version = "0.1.0" -source = "git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async#7ed796714c6b910053b8fe303d591582bfa917cb" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -447,15 +447,16 @@ dependencies = [ [[package]] name = "jsonrpc-client-http" -version = "0.1.0" -source = "git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async#7ed796714c6b910053b8fe303d591582bfa917cb" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-client-core 0.1.0 (git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async)", + "jsonrpc-client-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -464,7 +465,7 @@ name = "jsonrpc-core" version = "7.1.0" source = "git+https://github.com/paritytech/jsonrpc?tag=v7.1.0#a51a5265d85488c76a6ce8807d42d7dd25e94f1b" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -476,7 +477,7 @@ name = "jsonrpc-core" version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -664,9 +665,9 @@ dependencies = [ "ctrlc 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "fern 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-client-core 0.1.0 (git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async)", - "jsonrpc-client-http 0.1.0 (git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-client-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-client-http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 7.1.0 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.0)", "jsonrpc-macros 7.1.0 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.0)", "jsonrpc-pubsub 7.1.0 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.0)", @@ -1282,7 +1283,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1297,7 +1298,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1306,7 +1307,7 @@ name = "tokio-proto" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1323,7 +1324,7 @@ name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1331,7 +1332,7 @@ name = "tokio-tls" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1513,7 +1514,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fern 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "89273e0d0e210f69600048a209a00e163560b51e3ef51c3942304e9b8aa8b47a" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" -"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" +"checksum futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a82bdc62350ca9d7974c760e9665102fc9d740992a528c2254aa930e53b783c4" "checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff" "checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" @@ -1526,8 +1527,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be" "checksum ipnetwork 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)" = "232e76922883005380e831068f731ef0305541c9f77b30df3a1635047b16f370" "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" -"checksum jsonrpc-client-core 0.1.0 (git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async)" = "<none>" -"checksum jsonrpc-client-http 0.1.0 (git+https://github.com/mullvad/jsonrpc-client-rs?branch=rewrite-to-async)" = "<none>" +"checksum jsonrpc-client-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f21468a3d734c9b52358c06e7dda08bef647dfefa30ed1f4a78cf53e9bc0241" +"checksum jsonrpc-client-http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62a3fe12c388172dbbe749c6eb70096a8fd20c9fa32512bad5e7cccc135d5c42" "checksum jsonrpc-core 7.1.0 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.0)" = "<none>" "checksum jsonrpc-core 7.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "903e5eee845f3d83c1436d12848d97b1247cf850ff06a8e1db2f1ce3543af2cf" "checksum jsonrpc-macros 7.1.0 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.0)" = "<none>" diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml index 2c132d6c20..51241255c0 100644 --- a/mullvad-daemon/Cargo.toml +++ b/mullvad-daemon/Cargo.toml @@ -22,8 +22,8 @@ jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", tag = "v7.1.0" } jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc", tag = "v7.1.0" } jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc", tag = "v7.1.0" } jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc", tag = "v7.1.0" } -jsonrpc-client-core = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "rewrite-to-async" } -jsonrpc-client-http = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "rewrite-to-async" } +jsonrpc-client-core = "0.2" +jsonrpc-client-http = "0.2" uuid = { version = "0.5", features = ["v4"] } lazy_static = "0.2" toml = "0.4" 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)) } |
