Skip to content

Commit

Permalink
removed magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasiia Romaniuk committed Apr 7, 2021
1 parent 2fb9632 commit 0e0d1fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion devolutions-gateway/src/interceptor/pcap_recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ impl PcapRecordingInterceptor {
}

let (state, cond_var) = &*condition_timeout;
let result = cond_var.wait_timeout(state.lock().unwrap(), std::time::Duration::from_millis(timeout as u64));
let result = cond_var
.wait_timeout(state.lock().unwrap(), std::time::Duration::from_millis(timeout as u64));

match result {
Ok((state_result, timeout_result)) => match *state_result {
Expand Down
3 changes: 2 additions & 1 deletion devolutions-gateway/src/plugin_manager/recording.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use dlopen_derive::SymBorApi;
use std::{ffi::CString, io::Error, mem::transmute, os::raw::c_char, sync::Arc};

pub type RecordingContext = usize;
const MAX_PATH_LEN: u32 = 512;

#[allow(non_snake_case)]
#[derive(SymBorApi)]
Expand Down Expand Up @@ -101,7 +102,7 @@ impl Recorder {
}

pub fn get_filepath(&self) -> String {
let mut path_array = [0i8; 512];
let mut path_array = [0i8; MAX_PATH_LEN];
unsafe {
(self.api.NowRecording_GetPath)(self.ctx, path_array.as_mut_ptr());
}
Expand Down

0 comments on commit 0e0d1fe

Please sign in to comment.