summaryrefslogtreecommitdiffhomepage
path: root/talpid_openvpn_plugin/src/processing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'talpid_openvpn_plugin/src/processing.rs')
-rw-r--r--talpid_openvpn_plugin/src/processing.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/talpid_openvpn_plugin/src/processing.rs b/talpid_openvpn_plugin/src/processing.rs
deleted file mode 100644
index e33097c633..0000000000
--- a/talpid_openvpn_plugin/src/processing.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-use openvpn_ffi;
-
-use talpid_ipc::{IpcServerId, WsIpcClient};
-
-error_chain! {
- errors {
- IpcSendingError {
- description("Failed while sending an event over the IPC channel")
- }
- }
-}
-
-
-/// Struct processing OpenVPN events and notifies listeners over IPC
-pub struct EventProcessor {
- ipc_client: WsIpcClient,
-}
-
-impl EventProcessor {
- pub fn new(server_id: IpcServerId) -> Result<EventProcessor> {
- debug!("Creating EventProcessor");
- 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: openvpn_ffi::OpenVpnEnv)
- -> Result<()> {
- trace!("Processing \"{:?}\" event", event);
- self.ipc_client
- .call("openvpn_event", &(event, env))
- .map(|_: Option<()>| ())
- .chain_err(|| ErrorKind::IpcSendingError)
- }
-}
-
-impl Drop for EventProcessor {
- fn drop(&mut self) {
- // TODO(linus): If we need, this is where we send some shutdown event or similar to core.
- debug!("Dropping EventProcessor");
- }
-}