summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-03-07 12:59:32 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-03-07 12:59:32 +0100
commitb7e6675c663e23e6cbaa150b2540152e508684ed (patch)
treedaa6a7b4dc5779ff21d7b69d3cde26908bcb8c5d /src
parent79836cdcddff32feb1c30e0e7035f94ffc16053f (diff)
downloadmullvadvpn-b7e6675c663e23e6cbaa150b2540152e508684ed.tar.xz
mullvadvpn-b7e6675c663e23e6cbaa150b2540152e508684ed.zip
Make path to plugin configurable
Diffstat (limited to 'src')
-rw-r--r--src/process/openvpn.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/process/openvpn.rs b/src/process/openvpn.rs
index 48da508f75..a6af4742c3 100644
--- a/src/process/openvpn.rs
+++ b/src/process/openvpn.rs
@@ -171,14 +171,16 @@ pub enum OpenVpnEvent {
/// A struct able to start and monitor OpenVPN processes.
pub struct OpenVpnMonitor {
command: OpenVpnCommand,
+ plugin_path: PathBuf,
monitor: ChildMonitor<OpenVpnCommand>,
}
impl OpenVpnMonitor {
/// Creates a new `OpenVpnMonitor` based on the given command
- pub fn new(command: OpenVpnCommand) -> Self {
+ pub fn new<P: AsRef<Path>>(command: OpenVpnCommand, plugin_path: P) -> Self {
OpenVpnMonitor {
command: command.clone(),
+ plugin_path: plugin_path.as_ref().to_path_buf(),
monitor: ChildMonitor::new(command),
}
}
@@ -200,8 +202,7 @@ impl OpenVpnMonitor {
let mut listener = shared_listener.lock().unwrap();
(listener.deref_mut())(OpenVpnEvent::PluginEvent(chained_msg));
}).chain_err(|| ErrorKind::PluginCommunicationError)?;
- self.command.plugin("./target/debug/libtalpid_openvpn_plugin.so",
- vec![server_id]);
+ self.command.plugin(&self.plugin_path, vec![server_id]);
Ok(())
}