nfs: update ts only if it changed

Based on 8aa380600d
pull/5207/head
Victor Julien 5 years ago
parent b25de4d99a
commit 5d65e5a748

@ -376,6 +376,13 @@ impl NFSState {
ts: 0,
}
}
fn update_ts(&mut self, ts: u64) {
if ts != self.ts {
self.ts = ts;
}
}
pub fn free(&mut self) {
self.files.free();
}
@ -1425,7 +1432,7 @@ pub extern "C" fn rs_nfs_parse_request(flow: &mut Flow,
let buf = unsafe{std::slice::from_raw_parts(input, input_len as usize)};
SCLogDebug!("parsing {} bytes of request data", input_len);
state.ts = flow.get_last_time().as_secs();
state.update_ts(flow.get_last_time().as_secs());
state.parse_tcp_data_ts(buf)
}
@ -1450,7 +1457,7 @@ pub extern "C" fn rs_nfs_parse_response(flow: &mut Flow,
SCLogDebug!("parsing {} bytes of response data", input_len);
let buf = unsafe{std::slice::from_raw_parts(input, input_len as usize)};
state.ts = flow.get_last_time().as_secs();
state.update_ts(flow.get_last_time().as_secs());
state.parse_tcp_data_tc(buf)
}

Loading…
Cancel
Save