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.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/talpid-openvpn-plugin/src/processing.rs b/talpid-openvpn-plugin/src/processing.rs
index 291ad41092..c266c2d1b5 100644
--- a/talpid-openvpn-plugin/src/processing.rs
+++ b/talpid-openvpn-plugin/src/processing.rs
@@ -62,11 +62,20 @@ impl EventProcessor {
) -> Result<(), Error> {
log::debug!("Processing \"{:?}\" event", event);
- let future = self.ipc_client.event(proto::EventType {
- event: event as i16 as i32,
- env,
- });
- let response = self.runtime.block_on(future);
+ let details = proto::EventDetails { env };
+
+ let response = match event {
+ openvpn_plugin::EventType::AuthFailed => {
+ self.runtime.block_on(self.ipc_client.auth_failed(details))
+ }
+ openvpn_plugin::EventType::RouteUp => {
+ self.runtime.block_on(self.ipc_client.route_up(details))
+ }
+ openvpn_plugin::EventType::RoutePredown => self
+ .runtime
+ .block_on(self.ipc_client.route_predown(details)),
+ other => return Err(Error::UnhandledEvent(other)),
+ };
response.map(|_| ()).map_err(Error::SendEvent)
}
}