summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2018-09-11 13:20:18 +0100
committerEmīls Piņķis <emils@mullvad.net>2018-09-11 13:20:18 +0100
commitb3f21d87471d589b3ce8b1de08373b98ffe5cb09 (patch)
treef0b6b2c3f69dc2bdbeca531285675123f977a861
parent2a109139fa7f7992a574055df75b2677661f3143 (diff)
parent7dc6cb25328328695df47d8ce7bbf9d519431628 (diff)
downloadmullvadvpn-b3f21d87471d589b3ce8b1de08373b98ffe5cb09.tar.xz
mullvadvpn-b3f21d87471d589b3ce8b1de08373b98ffe5cb09.zip
Merge branch 'handle-rpc-calls-concurrently'
-rw-r--r--Cargo.lock115
-rw-r--r--mullvad-daemon/Cargo.toml8
-rw-r--r--mullvad-ipc-client/Cargo.toml2
-rw-r--r--mullvad-ipc-client/src/lib.rs27
-rw-r--r--mullvad-tests/Cargo.toml2
-rw-r--r--mullvad-tests/src/lib.rs17
-rw-r--r--talpid-core/Cargo.toml5
-rw-r--r--talpid-ipc/Cargo.toml13
-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, 139 insertions, 113 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3957e59b62..b1c25f5175 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -547,7 +547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "jsonrpc-client-core"
version = "0.5.0"
-source = "git+https://github.com/mullvad/jsonrpc-client-rs#32c0d940f6e0ff0ee11690d746bfbfecd9345ed7"
+source = "git+https://github.com/mullvad/jsonrpc-client-rs#e9dbdc807ccda4a9254ad39152dcaa7f2cef4888"
dependencies = [
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -586,12 +586,12 @@ dependencies = [
[[package]]
name = "jsonrpc-client-ipc"
version = "0.5.0"
-source = "git+https://github.com/mullvad/jsonrpc-client-rs#32c0d940f6e0ff0ee11690d746bfbfecd9345ed7"
+source = "git+https://github.com/mullvad/jsonrpc-client-rs#e9dbdc807ccda4a9254ad39152dcaa7f2cef4888"
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-server-utils 8.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "parity-tokio-ipc 0.1.5 (git+https://github.com/NikVolf/parity-tokio-ipc?rev=stable)",
+ "parity-tokio-ipc 0.1.5 (git+https://github.com/NikVolf/parity-tokio-ipc?rev=master)",
"tokio 0.1.7 (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)",
@@ -612,7 +612,7 @@ dependencies = [
[[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)",
@@ -624,32 +624,34 @@ dependencies = [
[[package]]
name = "jsonrpc-ipc-server"
version = "8.0.1"
-source = "git+https://github.com/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
+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/paritytech/jsonrpc)",
- "jsonrpc-server-utils 8.0.1 (git+https://github.com/paritytech/jsonrpc)",
+ "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/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
+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/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/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
+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/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)",
]
@@ -670,11 +672,11 @@ dependencies = [
[[package]]
name = "jsonrpc-server-utils"
version = "8.0.1"
-source = "git+https://github.com/paritytech/jsonrpc#98e892b07949b030461cd8781b2c7b635370327f"
+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/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)",
"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)",
@@ -919,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/paritytech/jsonrpc)",
- "jsonrpc-ipc-server 8.0.1 (git+https://github.com/paritytech/jsonrpc)",
- "jsonrpc-macros 8.0.1 (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-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)",
@@ -961,7 +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 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)",
]
@@ -1029,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]]
@@ -1203,36 +1205,34 @@ 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-named-pipes 0.1.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 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.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-tokio-ipc"
version = "0.1.5"
-source = "git+https://github.com/NikVolf/parity-tokio-ipc?rev=stable#b4a6cdf7d9b1e51c5d744d7f47d391a69a943232"
+source = "git+https://github.com/NikVolf/parity-tokio-ipc?rev=master#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-named-pipes 0.1.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 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.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1635,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/paritytech/jsonrpc)",
- "jsonrpc-macros 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-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)",
@@ -1669,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/paritytech/jsonrpc)",
- "jsonrpc-ipc-server 8.0.1 (git+https://github.com/paritytech/jsonrpc)",
- "jsonrpc-macros 8.0.1 (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-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)",
]
@@ -1692,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)",
]
@@ -1836,14 +1837,14 @@ dependencies = [
[[package]]
name = "tokio-named-pipes"
-version = "0.1.0"
-source = "git+https://github.com/nikvolf/tokio-named-pipes?branch=stable#9a9372618552d2c25c2ee4511e5e0fb4eef318e3"
+version = "0.2.0"
+source = "git+https://github.com/nikvolf/tokio-named-pipes?branch=stable#0afa6247222a7aa6e8b370e949a0f4007f0018b6"
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)",
+ "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)",
- "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)",
]
[[package]]
@@ -1954,18 +1955,18 @@ dependencies = [
[[package]]
name = "tokio-uds"
-version = "0.1.7"
+version = "0.2.1"
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)",
+ "log 0.4.3 (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)",
+ "tokio-reactor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2231,12 +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/paritytech/jsonrpc)" = "<none>"
-"checksum jsonrpc-ipc-server 8.0.1 (git+https://github.com/paritytech/jsonrpc)" = "<none>"
-"checksum jsonrpc-macros 8.0.1 (git+https://github.com/paritytech/jsonrpc)" = "<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/paritytech/jsonrpc)" = "<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"
@@ -2277,8 +2278,8 @@ source = "git+https://github.com/mullvad/rust-openssl#4dbd237fe1f6454d8a0042ccf4
"checksum os_pipe 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fe033225d563042c3eeb22ffd1d2ea1aefcc48e7e37151a064c9e0bae64b253f"
"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=stable)" = "<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?rev=master)" = "<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"
@@ -2341,7 +2342,7 @@ source = "git+https://github.com/mullvad/rust-openssl#4dbd237fe1f6454d8a0042ccf4
"checksum tokio-executor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "424f0c87ecd66b863045d84e384cb7ce0ae384d8b065b9f0363d29c0d1b30b2f"
"checksum tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5cbe4ca6e71cb0b62a66e4e6f53a8c06a6eefe46cc5f665ad6f274c9906f135"
"checksum tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a5c9635ee806f26d302b8baa1e145689a280d8f5aa8d0552e7344808da54cc21"
-"checksum tokio-named-pipes 0.1.0 (git+https://github.com/nikvolf/tokio-named-pipes?branch=stable)" = "<none>"
+"checksum tokio-named-pipes 0.2.0 (git+https://github.com/nikvolf/tokio-named-pipes?branch=stable)" = "<none>"
"checksum tokio-openssl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4646ae1fd623393de3d796ea53af75acd02938dd5579544fbd6d236d041978a6"
"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
"checksum tokio-reactor 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8703a5762ff6913510dc64272c714c4389ffd8c4b3cf602879b8bd14ff06b604"
@@ -2351,7 +2352,7 @@ 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"
"checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a"
diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml
index b6cd7a9884..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/paritytech/jsonrpc", branch = "master" }
-jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
-jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
-jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
+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 443cffa885..e51cd8d4bd 100644
--- a/mullvad-ipc-client/Cargo.toml
+++ b/mullvad-ipc-client/Cargo.toml
@@ -14,7 +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-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 b03c741589..e0b6d0692a 100644
--- a/mullvad-ipc-client/src/lib.rs
+++ b/mullvad-ipc-client/src/lib.rs
@@ -13,7 +13,7 @@ extern crate mullvad_types;
extern crate serde;
extern crate talpid_ipc;
extern crate talpid_types;
-extern crate tokio_core;
+extern crate tokio;
extern crate tokio_timer;
use std::path::Path;
@@ -37,7 +37,6 @@ use futures::sync::oneshot;
use jsonrpc_client_core::{Client, ClientHandle, Future};
pub use jsonrpc_client_core::{Error as RpcError, ErrorKind as RpcErrorKind};
use jsonrpc_client_ipc::IpcTransport;
-use tokio_core::reactor;
error_chain! {
errors {
@@ -73,7 +72,7 @@ error_chain! {
static NO_ARGS: [u8; 0] = [];
pub fn new_standalone_transport<
- F: Send + 'static + FnOnce(String, reactor::Handle) -> Result<T>,
+ F: Send + 'static + FnOnce(String) -> Result<T>,
T: jsonrpc_client_core::Transport,
>(
rpc_path: String,
@@ -84,10 +83,11 @@ 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) = core.run(client) {
+
+ 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, 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<(reactor::Core, Client<T>, ClientHandle)> {
- let core = reactor::Core::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 {
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 1041d184a3..b724906a7a 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -10,8 +10,9 @@ atty = "0.2"
duct = "0.11"
error-chain = "0.12"
futures = "0.1"
-jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
-jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
+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"
openvpn-plugin = { version = "0.3", features = ["serde"] }
diff --git a/talpid-ipc/Cargo.toml b/talpid-ipc/Cargo.toml
index 45848b45ca..6123a0fd08 100644
--- a/talpid-ipc/Cargo.toml
+++ b/talpid-ipc/Cargo.toml
@@ -10,16 +10,19 @@ error-chain = "0.12"
serde = "1.0"
serde_json = "1.0"
log = "0.4"
-jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
-jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
-jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc", branch = "master" }
+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" }
[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()
}