summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-03-08 10:37:29 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-03-08 10:37:29 +0100
commitf2cc9fddc38eb7e3c75b2dccff8f135d30425c4d (patch)
tree4fb239d78be4126d11b95e1f841c2dfe858a094c /src
parent79836cdcddff32feb1c30e0e7035f94ffc16053f (diff)
parent34273d87d72ef5db7bfc240704eb9ea56255764f (diff)
downloadmullvadvpn-f2cc9fddc38eb7e3c75b2dccff8f135d30425c4d.tar.xz
mullvadvpn-f2cc9fddc38eb7e3c75b2dccff8f135d30425c4d.zip
Merge branch 'configurable-plugin-path'
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(())
}