summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock131
-rw-r--r--mullvad-daemon/Cargo.toml8
-rw-r--r--mullvad-ipc-client/Cargo.toml3
-rw-r--r--mullvad-ipc-client/src/lib.rs39
-rw-r--r--mullvad-tests/Cargo.toml2
-rw-r--r--mullvad-tests/src/lib.rs17
-rw-r--r--talpid-core/Cargo.toml4
-rw-r--r--talpid-ipc/Cargo.toml12
-rw-r--r--talpid-ipc/src/lib.rs15
-rw-r--r--talpid-ipc/tests/ipc-client-server.rs8
-rw-r--r--talpid-openvpn-plugin/Cargo.toml3
-rw-r--r--talpid-openvpn-plugin/src/lib.rs3
-rw-r--r--talpid-openvpn-plugin/src/processing.rs34
13 files changed, 118 insertions, 161 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 10828cbf35..b1c25f5175 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -612,19 +612,7 @@ dependencies = [
[[package]]
name = "jsonrpc-core"
version = "8.0.2"
-source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent#1e76ca656bdd80ebad6eb33f29a4869407fb119b"
-dependencies = [
- "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "jsonrpc-core"
-version = "8.0.2"
-source = "git+https://github.com/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
+source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux#40344ea49836a6a0040c49c927610608bd3c4a8a"
dependencies = [
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -636,52 +624,34 @@ dependencies = [
[[package]]
name = "jsonrpc-ipc-server"
version = "8.0.1"
-source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent#1e76ca656bdd80ebad6eb33f29a4869407fb119b"
+source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux#40344ea49836a6a0040c49c927610608bd3c4a8a"
dependencies = [
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-server-utils 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
+ "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-server-utils 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc?branch=stable)",
+ "parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)",
"parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-macros"
version = "8.0.1"
-source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent#1e76ca656bdd80ebad6eb33f29a4869407fb119b"
+source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux#40344ea49836a6a0040c49c927610608bd3c4a8a"
dependencies = [
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "jsonrpc-macros"
-version = "8.0.1"
-source = "git+https://github.com/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
-dependencies = [
- "jsonrpc-core 8.0.2 (git+https://github.com/paritytech/jsonrpc)",
- "jsonrpc-pubsub 8.0.1 (git+https://github.com/paritytech/jsonrpc)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "jsonrpc-pubsub"
version = "8.0.1"
-source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent#1e76ca656bdd80ebad6eb33f29a4869407fb119b"
+source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux#40344ea49836a6a0040c49c927610608bd3c4a8a"
dependencies = [
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "jsonrpc-pubsub"
-version = "8.0.1"
-source = "git+https://github.com/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
-dependencies = [
- "jsonrpc-core 8.0.2 (git+https://github.com/paritytech/jsonrpc)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -702,11 +672,11 @@ dependencies = [
[[package]]
name = "jsonrpc-server-utils"
version = "8.0.1"
-source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent#1e76ca656bdd80ebad6eb33f29a4869407fb119b"
+source = "git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux#40344ea49836a6a0040c49c927610608bd3c4a8a"
dependencies = [
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -951,10 +921,10 @@ dependencies = [
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fern 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -993,8 +963,7 @@ dependencies = [
"serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
"talpid-ipc 0.1.0",
"talpid-types 0.1.0",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-reactor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1062,7 +1031,7 @@ dependencies = [
"talpid-ipc 0.1.0",
"talpid-types 0.1.0",
"tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1236,18 +1205,17 @@ dependencies = [
[[package]]
name = "parity-tokio-ipc"
version = "0.1.5"
-source = "git+https://github.com/nikvolf/parity-tokio-ipc?branch=stable#b4a6cdf7d9b1e51c5d744d7f47d391a69a943232"
+source = "git+https://github.com/nikvolf/parity-tokio-ipc#306ea3e6ff8b8c1bb0308183af3eefd761cff9a3"
dependencies = [
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)",
"miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-named-pipes 0.2.0 (git+https://github.com/nikvolf/tokio-named-pipes?branch=stable)",
- "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1258,7 +1226,7 @@ source = "git+https://github.com/NikVolf/parity-tokio-ipc?rev=master#306ea3e6ff8
dependencies = [
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)",
"miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1667,8 +1635,8 @@ dependencies = [
"failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"ipnetwork 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1701,14 +1669,14 @@ dependencies = [
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-client-core 0.5.0 (git+https://github.com/mullvad/jsonrpc-client-rs)",
"jsonrpc-client-ipc 0.5.0 (git+https://github.com/mullvad/jsonrpc-client-rs)",
- "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
- "jsonrpc-macros 8.0.1 (git+https://github.com/paritytech/jsonrpc)",
- "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)",
+ "jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
+ "jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.71 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1724,7 +1692,8 @@ dependencies = [
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"openvpn-plugin 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"talpid-ipc 0.1.0",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-reactor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"windres 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1986,22 +1955,6 @@ dependencies = [
[[package]]
name = "tokio-uds"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio-uds 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-uds"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
@@ -2279,15 +2232,12 @@ source = "git+https://github.com/mullvad/rust-openssl#4dbd237fe1f6454d8a0042ccf4
"checksum jsonrpc-client-http 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e642eb74423b9dfcb4512fda167148746b76f788a823cd712fadf409f31d302"
"checksum jsonrpc-client-ipc 0.5.0 (git+https://github.com/mullvad/jsonrpc-client-rs)" = "<none>"
"checksum jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c"
-"checksum jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)" = "<none>"
-"checksum jsonrpc-core 8.0.2 (git+https://github.com/paritytech/jsonrpc)" = "<none>"
-"checksum jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)" = "<none>"
-"checksum jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)" = "<none>"
-"checksum jsonrpc-macros 8.0.1 (git+https://github.com/paritytech/jsonrpc)" = "<none>"
-"checksum jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)" = "<none>"
-"checksum jsonrpc-pubsub 8.0.1 (git+https://github.com/paritytech/jsonrpc)" = "<none>"
+"checksum jsonrpc-core 8.0.2 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)" = "<none>"
+"checksum jsonrpc-ipc-server 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)" = "<none>"
+"checksum jsonrpc-macros 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)" = "<none>"
+"checksum jsonrpc-pubsub 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)" = "<none>"
"checksum jsonrpc-server-utils 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "513e981828a4953ea7ddbb64c24d15d4983ecf6900dc1cd36f257d61c27138d5"
-"checksum jsonrpc-server-utils 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent)" = "<none>"
+"checksum jsonrpc-server-utils 8.0.1 (git+https://github.com/mullvad/jsonrpc?branch=make-ipc-server-concurrent-part-deux)" = "<none>"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
@@ -2329,7 +2279,7 @@ source = "git+https://github.com/mullvad/rust-openssl#4dbd237fe1f6454d8a0042ccf4
"checksum os_pipe 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9d339267cdef39ee54ef165fdfaa2c7289a7465f0188ebe1c8a63872ca64c7"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/NikVolf/parity-tokio-ipc?rev=master)" = "<none>"
-"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc?branch=stable)" = "<none>"
+"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>"
"checksum parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69376b761943787ebd5cc85a5bc95958651a22609c5c1c2b65de21786baec72b"
"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
@@ -2402,7 +2352,6 @@ source = "git+https://github.com/mullvad/rust-openssl#4dbd237fe1f6454d8a0042ccf4
"checksum tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc"
"checksum tokio-timer 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1c76b4e97a4f61030edff8bd272364e4f731b9f54c7307eb4eb733c3926eb96a"
"checksum tokio-udp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43eb534af6e8f37d43ab1b612660df14755c42bd003c5f8d2475ee78cc4600c0"
-"checksum tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "65ae5d255ce739e8537221ed2942e0445f4b3b813daebac1c0050ddaaa3587f9"
"checksum tokio-uds 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "424c1ed15a0132251813ccea50640b224c809d6ceafb88154c1a8775873a0e89"
"checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml
index 6c5533f9f9..58f6ded57e 100644
--- a/mullvad-daemon/Cargo.toml
+++ b/mullvad-daemon/Cargo.toml
@@ -15,10 +15,10 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4"
log-panics = "2.0.0"
-jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-macros = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-pubsub = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-ipc-server = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
+jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-macros = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-pubsub = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-ipc-server = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
uuid = { version = "0.6", features = ["v4"] }
lazy_static = "1.0"
rand = "0.5"
diff --git a/mullvad-ipc-client/Cargo.toml b/mullvad-ipc-client/Cargo.toml
index 18f4727da9..e51cd8d4bd 100644
--- a/mullvad-ipc-client/Cargo.toml
+++ b/mullvad-ipc-client/Cargo.toml
@@ -14,8 +14,7 @@ talpid-types = { path = "../talpid-types" }
mullvad-paths = { path = "../mullvad-paths" }
jsonrpc-client-core = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "master" }
jsonrpc-client-ipc = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "master" }
-tokio-reactor = "0.1"
-tokio-core = "0.1"
+tokio = "0.1"
tokio-timer = "0.1"
futures = "0.1"
log = "0.4"
diff --git a/mullvad-ipc-client/src/lib.rs b/mullvad-ipc-client/src/lib.rs
index be250fe1ea..e0b6d0692a 100644
--- a/mullvad-ipc-client/src/lib.rs
+++ b/mullvad-ipc-client/src/lib.rs
@@ -13,8 +13,7 @@ extern crate mullvad_types;
extern crate serde;
extern crate talpid_ipc;
extern crate talpid_types;
-extern crate tokio_core;
-extern crate tokio_reactor;
+extern crate tokio;
extern crate tokio_timer;
use std::path::Path;
@@ -73,7 +72,7 @@ error_chain! {
static NO_ARGS: [u8; 0] = [];
pub fn new_standalone_transport<
- F: Send + 'static + FnOnce(String, tokio_reactor::Handle) -> Result<T>,
+ F: Send + 'static + FnOnce(String) -> Result<T>,
T: jsonrpc_client_core::Transport,
>(
rpc_path: String,
@@ -84,9 +83,10 @@ pub fn new_standalone_transport<
Err(e) => tx
.send(Err(e))
.expect("Failed to send error back to caller"),
- Ok((mut core, client, client_handle)) => {
+ Ok((client, client_handle)) => {
tx.send(Ok(client_handle))
.expect("Failed to send client handle");
+
if let Err(e) = client.wait() {
error!("JSON-RPC client failed: {}", e.description());
}
@@ -101,21 +101,18 @@ pub fn new_standalone_transport<
pub fn new_standalone_ipc_client(path: &impl AsRef<Path>) -> Result<DaemonRpcClient> {
let path = path.as_ref().to_string_lossy().to_string();
- new_standalone_transport(path, |path, handle| {
- IpcTransport::new(&path, &handle).chain_err(|| ErrorKind::TransportError)
+ new_standalone_transport(path, |path| {
+ IpcTransport::new(&path, &tokio::reactor::Handle::current())
+ .chain_err(|| ErrorKind::TransportError)
})
}
-fn spawn_transport<
- F: Send + FnOnce(String, tokio_reactor::Handle) -> Result<T>,
- T: jsonrpc_client_core::Transport,
->(
+fn spawn_transport<F: Send + FnOnce(String) -> Result<T>, T: jsonrpc_client_core::Transport>(
address: String,
transport_func: F,
-) -> Result<(tokio_reactor::Reactor, Client<T>, ClientHandle)> {
- let core = tokio_reactor::Reactor::new().chain_err(|| ErrorKind::TokioError)?;
- let (client, client_handle) = transport_func(address, core.handle())?.into_client();
- Ok((core, client, client_handle))
+) -> Result<(Client<T>, ClientHandle)> {
+ let (client, client_handle) = transport_func(address)?.into_client();
+ Ok((client, client_handle))
}
pub struct DaemonRpcClient {
@@ -223,20 +220,6 @@ impl DaemonRpcClient {
.chain_err(|| ErrorKind::RpcCallError(method.to_owned()))
}
- pub fn call_async<T, A> (&mut self, method: &'static str, args: A) -> Box<Future<Item=(), Error=()>>
- where
- T:for<'de> Deserialize<'de> + Send + 'static + std::fmt::Debug,
- A: Serialize + Send + 'static,
- {
- let meth = method.to_string();
- Box::new(self.rpc_client
- .call_method(method, &args)
- .then(move |result: std::result::Result<T, _>| {
- println!("received {} - {:?}",meth, result );
- futures::future::ok(())
- }))
- }
-
pub fn new_state_subscribe(&mut self) -> Result<mpsc::Receiver<TunnelStateTransition>> {
let client = self.rpc_client.clone();
let mut current_state = self.get_state()?;
diff --git a/mullvad-tests/Cargo.toml b/mullvad-tests/Cargo.toml
index c9814f32b1..fc9a74d8b2 100644
--- a/mullvad-tests/Cargo.toml
+++ b/mullvad-tests/Cargo.toml
@@ -19,7 +19,7 @@ talpid-types = { path = "../talpid-types" }
tempfile = "3.0"
jsonrpc-client-core = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "master" }
jsonrpc-client-ipc = { git = "https://github.com/mullvad/jsonrpc-client-rs", branch = "master" }
-tokio-core = "0.1"
+tokio = "0.1"
futures = "0.1.23"
[target.'cfg(unix)'.dependencies]
diff --git a/mullvad-tests/src/lib.rs b/mullvad-tests/src/lib.rs
index 30c602ee70..6683eb9be1 100644
--- a/mullvad-tests/src/lib.rs
+++ b/mullvad-tests/src/lib.rs
@@ -12,7 +12,7 @@ extern crate talpid_ipc;
extern crate tempfile;
extern crate futures;
-extern crate tokio_core;
+extern crate tokio;
pub mod mock_openvpn;
@@ -31,7 +31,7 @@ use mullvad_paths::resources::API_CA_FILENAME;
use notify::{RawEvent, RecommendedWatcher, RecursiveMode, Watcher};
use openvpn_plugin::types::OpenVpnPluginEvent;
use tempfile::TempDir;
-use tokio_core::reactor::Core;
+use tokio::reactor::Handle;
use self::mock_openvpn::MOCK_OPENVPN_ARGS_FILE;
use self::platform_specific::*;
@@ -312,8 +312,8 @@ impl DaemonRunner {
pub fn rpc_client(&mut self) -> Result<DaemonRpcClient> {
wait_for_file(&self.rpc_socket_path);
let socket_path: String = self.rpc_socket_path.to_string_lossy().to_string();
- mullvad_ipc_client::new_standalone_transport(socket_path, |path, handle| {
- IpcTransport::new(&path, &handle)
+ mullvad_ipc_client::new_standalone_transport(socket_path, |path| {
+ IpcTransport::new(&path, &Handle::current())
.chain_err(|| mullvad_ipc_client::ErrorKind::TransportError)
}).map_err(|e| format!("Failed to construct an RPC client - {}", e))
}
@@ -369,16 +369,17 @@ impl MockOpenVpnPluginRpcClient {
fn spawn_event_loop(address: String) -> Result<jsonrpc_client_core::ClientHandle> {
let (tx, rx) = oneshot::channel();
thread::spawn(move || {
- let mut core = Core::new().expect("failed to spawn an event loop");
-
- let result = IpcTransport::new(&address, &core.handle())
+ let result = IpcTransport::new(&address, &Handle::current())
.map_err(|error| {
format!("Failed to create Mock OpenVPN plugin RPC client: {}", error)
}).map(Transport::into_client);
match result {
Ok((client, client_handle)) => {
tx.send(Ok(client_handle)).unwrap();
- core.run(client).expect("client failed");
+ tokio::run(client.map_err(|e| {
+ println!("RPC client failed: {}", e);
+ ()
+ }));
}
Err(e) => tx.send(Err(e)).unwrap(),
}
diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml
index 94eb007758..b724906a7a 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -10,8 +10,8 @@ atty = "0.2"
duct = "0.11"
error-chain = "0.12"
futures = "0.1"
-jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-macros = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
+jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-macros = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
libc = "0.2.20"
log = "0.4"
diff --git a/talpid-ipc/Cargo.toml b/talpid-ipc/Cargo.toml
index 1e4a5fe065..6123a0fd08 100644
--- a/talpid-ipc/Cargo.toml
+++ b/talpid-ipc/Cargo.toml
@@ -10,9 +10,11 @@ error-chain = "0.12"
serde = "1.0"
serde_json = "1.0"
log = "0.4"
-jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-pubsub = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
-jsonrpc-ipc-server = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent" }
+jsonrpc-core = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-pubsub = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+jsonrpc-ipc-server = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
+tokio = "0.1"
+futures = "0.1"
jsonrpc-client-core = { git = "https://github.com/mullvad/jsonrpc-client-rs" }
jsonrpc-client-ipc = { git = "https://github.com/mullvad/jsonrpc-client-rs" }
@@ -20,7 +22,7 @@ jsonrpc-client-ipc = { git = "https://github.com/mullvad/jsonrpc-client-rs" }
[dev-dependencies]
assert_matches = "1.0"
env_logger = "0.5"
-jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
+jsonrpc-macros = { git = "https://github.com/mullvad/jsonrpc", branch = "make-ipc-server-concurrent-part-deux" }
uuid = { version = "0.6", features = ["v4"] }
futures = "0.1.23"
-tokio-core = "0.1"
+tokio = "0.1"
diff --git a/talpid-ipc/src/lib.rs b/talpid-ipc/src/lib.rs
index 6104a59848..16d952a5be 100644
--- a/talpid-ipc/src/lib.rs
+++ b/talpid-ipc/src/lib.rs
@@ -18,8 +18,13 @@ extern crate jsonrpc_core;
extern crate jsonrpc_ipc_server;
extern crate jsonrpc_pubsub;
+extern crate futures;
extern crate jsonrpc_client_core;
extern crate jsonrpc_client_ipc;
+extern crate tokio;
+
+use futures::Future;
+use std::thread;
use jsonrpc_core::{MetaIoHandler, Metadata};
use jsonrpc_ipc_server::{MetaExtractor, NoopExtractor, SecurityAttributes, Server, ServerBuilder};
@@ -68,7 +73,15 @@ impl IpcServer {
.set_security_attributes(security_attributes)
.start(&path)
.chain_err(|| ErrorKind::IpcServerError)
- .map(|server| IpcServer {
+ .and_then(|(fut, start, server)| {
+ thread::spawn(move || tokio::run(fut));
+ start
+ .wait()
+ .expect("server panicked")
+ .map(|e| Err(e))
+ .unwrap_or(Ok(server))
+ .chain_err(|| ErrorKind::IpcServerError)
+ }).map(|server| IpcServer {
path: path.to_owned(),
server,
})?;
diff --git a/talpid-ipc/tests/ipc-client-server.rs b/talpid-ipc/tests/ipc-client-server.rs
index dc5c8d9d17..a155813efe 100644
--- a/talpid-ipc/tests/ipc-client-server.rs
+++ b/talpid-ipc/tests/ipc-client-server.rs
@@ -7,14 +7,13 @@ extern crate jsonrpc_core;
#[macro_use]
extern crate jsonrpc_macros;
extern crate talpid_ipc;
-extern crate tokio_core;
+extern crate tokio;
extern crate uuid;
extern crate futures;
use futures::sync::oneshot;
use futures::Future;
-use tokio_core::reactor::Core;
use jsonrpc_client_core::{Error as ClientError, Transport};
use jsonrpc_core::{Error, IoHandler};
@@ -86,13 +85,12 @@ fn create_client(ipc_path: String) -> jsonrpc_client_core::ClientHandle {
let (tx, rx) = oneshot::channel();
thread::spawn(move || {
- let mut core = Core::new().expect("failed to spawn reactor");
let (client, client_handle) =
- jsonrpc_client_ipc::IpcTransport::new(&ipc_path, &core.handle())
+ jsonrpc_client_ipc::IpcTransport::new(&ipc_path, &tokio::reactor::Handle::current())
.expect("failed to construct a transport")
.into_client();
tx.send(client_handle).unwrap();
- core.run(client).unwrap();
+ client.wait().unwrap();
});
let handle = rx.wait().expect("Failed to construct a valid client");
diff --git a/talpid-openvpn-plugin/Cargo.toml b/talpid-openvpn-plugin/Cargo.toml
index 165a4976be..626e71a134 100644
--- a/talpid-openvpn-plugin/Cargo.toml
+++ b/talpid-openvpn-plugin/Cargo.toml
@@ -14,7 +14,8 @@ log = "0.4"
env_logger = "0.5"
jsonrpc-client-core = { git = "https://github.com/mullvad/jsonrpc-client-rs" }
jsonrpc-client-ipc = { git = "https://github.com/mullvad/jsonrpc-client-rs" }
-tokio-core = "0.1"
+tokio-reactor = "0.1"
+tokio = "0.1"
futures = "0.1"
openvpn-plugin = { version = "0.3", features = ["serde", "log"] }
diff --git a/talpid-openvpn-plugin/src/lib.rs b/talpid-openvpn-plugin/src/lib.rs
index ed358a5df7..b257b12cab 100644
--- a/talpid-openvpn-plugin/src/lib.rs
+++ b/talpid-openvpn-plugin/src/lib.rs
@@ -18,7 +18,8 @@ extern crate futures;
extern crate jsonrpc_client_ipc;
#[macro_use]
extern crate openvpn_plugin;
-extern crate tokio_core;
+extern crate tokio;
+extern crate tokio_reactor;
use error_chain::ChainedError;
use openvpn_plugin::types::{EventResult, OpenVpnPluginEvent};
diff --git a/talpid-openvpn-plugin/src/processing.rs b/talpid-openvpn-plugin/src/processing.rs
index 66d009b44f..fde658a7f9 100644
--- a/talpid-openvpn-plugin/src/processing.rs
+++ b/talpid-openvpn-plugin/src/processing.rs
@@ -5,9 +5,12 @@ extern crate futures;
use jsonrpc_client_core::{Future, Result as ClientResult, Transport};
use jsonrpc_client_ipc::IpcTransport;
-use tokio_core::reactor::Core;
+
+use tokio::reactor::Handle;
+use tokio::runtime::Runtime;
use super::Arguments;
+use std::thread;
error_chain! {
errors {
@@ -27,29 +30,36 @@ error_chain! {
pub struct EventProcessor {
ipc_client: EventProxy,
client_stop: ::std::sync::mpsc::Receiver<ClientResult<()>>,
- core: Core,
}
impl EventProcessor {
pub fn new(arguments: Arguments) -> Result<EventProcessor> {
trace!("Creating EventProcessor");
- let core = Core::new().chain_err(|| "Unable to initialize Tokio Core")?;
- let handle = core.handle();
- let (client, client_handle) = IpcTransport::new(&arguments.ipc_socket_path, &handle)
- .chain_err(|| "Unable to create IPC transport")?
- .into_client();
+ let (start_tx, start_rx) = futures::sync::oneshot::channel();
+ thread::spawn(move || {
+ let mut rt = Runtime::new().expect("failed to spawn runtime");
+
+ let (client, client_handle) =
+ IpcTransport::new(&arguments.ipc_socket_path, &Handle::current())
+ .expect("Unable to create IPC transport")
+ .into_client();
- let (tx, client_stop) = ::std::sync::mpsc::channel();
+ let (tx, client_stop) = ::std::sync::mpsc::channel();
+ let client_future = client.then(move |result| tx.send(result)).map_err(|_| ());
+ start_tx
+ .send((client_stop, client_handle))
+ .expect("failed to send client handles");
- let client_future = client.then(move |result| tx.send(result)).map_err(|_| ());
- handle.spawn(client_future);
+ rt.block_on(client_future)
+ .expect("RPC client should not fail");
+ });
+ let (client_stop, client_handle) = start_rx.wait().chain_err(|| ErrorKind::Shutdown)?;
let ipc_client = EventProxy::new(client_handle);
Ok(EventProcessor {
ipc_client,
client_stop,
- core,
})
}
@@ -63,7 +73,7 @@ impl EventProcessor {
.ipc_client
.openvpn_event(event, env)
.map_err(|e| Error::with_chain(e, ErrorKind::IpcSendingError));
- self.core.run(call_future)?;
+ call_future.wait()?;
self.check_client_status()
}