diff options
| author | David Lönnhager <david.l@mullvad.net> | 2022-03-30 10:43:34 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2022-04-05 10:33:59 +0200 |
| commit | 26248ee268c1136ddaf48e9444fb11099cce0af5 (patch) | |
| tree | 577e8aaddf66f4a4d09e40972b1fecc4675d0ad9 | |
| parent | ec1dce1b2e1c82be9920f940251535fce4fa2b0a (diff) | |
| download | mullvadvpn-26248ee268c1136ddaf48e9444fb11099cce0af5.tar.xz mullvadvpn-26248ee268c1136ddaf48e9444fb11099cce0af5.zip | |
Add another worker thread for shadowsocks
| -rw-r--r-- | talpid-core/src/tunnel/openvpn/mod.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/talpid-core/src/tunnel/openvpn/mod.rs b/talpid-core/src/tunnel/openvpn/mod.rs index f3ae44b7ea..d8f0f0c729 100644 --- a/talpid-core/src/tunnel/openvpn/mod.rs +++ b/talpid-core/src/tunnel/openvpn/mod.rs @@ -290,11 +290,7 @@ impl OpenVpnMonitor<OpenVpnCommand> { log_dir, }; - let runtime = tokio::runtime::Builder::new_multi_thread() - .worker_threads(1) - .enable_all() - .build() - .map_err(Error::RuntimeError)?; + let runtime = new_runtime()?; let proxy_monitor = runtime.block_on(Self::start_proxy(¶ms.proxy, &proxy_resources))?; @@ -1119,6 +1115,14 @@ mod event_server { } } +fn new_runtime() -> Result<tokio::runtime::Runtime> { + tokio::runtime::Builder::new_multi_thread() + .worker_threads(2) + .enable_all() + .build() + .map_err(Error::RuntimeError) +} + #[cfg(test)] mod tests { use super::*; @@ -1240,13 +1244,8 @@ mod tests { where L: event_server::OpenvpnEventProxy + Send + Sync + 'static, { - let runtime = tokio::runtime::Builder::new_multi_thread() - .worker_threads(1) - .enable_all() - .build() - .map_err(Error::RuntimeError)?; OpenVpnMonitor::new_internal_with_runtime( - runtime, + new_runtime()?, cmd, event_server_abort_tx, event_server_abort_rx, |
