summaryrefslogtreecommitdiffhomepage
path: root/talpid_openvpn_plugin/src/processing.rs
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-05-23 09:19:07 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-05-23 09:19:07 +0200
commit649a0d5bae81ac6b1b1385fd9ad013f4c3134515 (patch)
treed42b64f98517ab7ea20f0bddc13aae2208632847 /talpid_openvpn_plugin/src/processing.rs
parentce6f18887987675762df78a6499bb4d8f3c56618 (diff)
parentcc9d15ae1af8ba4cd12696c0de8755c45b43c921 (diff)
downloadmullvadvpn-649a0d5bae81ac6b1b1385fd9ad013f4c3134515.tar.xz
mullvadvpn-649a0d5bae81ac6b1b1385fd9ad013f4c3134515.zip
Merge branch 'websocket-ipc-client'
Diffstat (limited to 'talpid_openvpn_plugin/src/processing.rs')
-rw-r--r--talpid_openvpn_plugin/src/processing.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/talpid_openvpn_plugin/src/processing.rs b/talpid_openvpn_plugin/src/processing.rs
index b1f1b97abc..dd6967135e 100644
--- a/talpid_openvpn_plugin/src/processing.rs
+++ b/talpid_openvpn_plugin/src/processing.rs
@@ -1,9 +1,6 @@
use openvpn_ffi;
-use std::collections::HashMap;
-
-use talpid_ipc::{IpcClient, IpcServerId};
-
+use talpid_ipc::{IpcServerId, WsIpcClient};
error_chain! {
errors {
@@ -16,22 +13,24 @@ error_chain! {
/// Struct processing OpenVPN events and notifies listeners over IPC
pub struct EventProcessor {
- ipc_client: IpcClient<(openvpn_ffi::OpenVpnPluginEvent, HashMap<String, String>)>,
+ ipc_client: WsIpcClient,
}
impl EventProcessor {
pub fn new(server_id: IpcServerId) -> Result<EventProcessor> {
debug!("Creating EventProcessor");
- let ipc_client = IpcClient::new(server_id);
- Ok(EventProcessor { ipc_client: ipc_client })
+ let ipc_client = WsIpcClient::new(server_id).chain_err(|| "Unable to create IPC client")?;
+ Ok(EventProcessor { ipc_client })
}
pub fn process_event(&mut self,
event: openvpn_ffi::OpenVpnPluginEvent,
- env: HashMap<String, String>)
+ env: openvpn_ffi::OpenVpnEnv)
-> Result<()> {
trace!("Processing \"{:?}\" event", event);
- self.ipc_client.send(&(event, env)).chain_err(|| ErrorKind::IpcSendingError)
+ self.ipc_client
+ .call("openvpn_event", &(event, env))
+ .chain_err(|| ErrorKind::IpcSendingError)
}
}