From: Victor Julien Date: Sun, 17 May 2020 12:24:07 +0000 (+0200) Subject: smb: check post-gap timeouts once a second at most X-Git-Tag: suricata-5.0.5~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83c9b305acc6d48eb96172292609f6e73185c7dd;p=thirdparty%2Fsuricata.git smb: check post-gap timeouts once a second at most (cherry picked from commit 25f2efe97749611760e6e26d388b420091423732) --- diff --git a/rust/src/smb/smb.rs b/rust/src/smb/smb.rs index e785c1cf6e..6b4f585207 100644 --- a/rust/src/smb/smb.rs +++ b/rust/src/smb/smb.rs @@ -787,6 +787,7 @@ pub struct SMBState<> { /// true as long as we have file txs that are in a post-gap /// state. It means we'll do extra house keeping for those. check_post_gap_file_txs: bool, + post_gap_files_checked: bool, /// transactions list pub transactions: Vec, @@ -833,6 +834,7 @@ impl SMBState { ts_trunc: false, tc_trunc: false, check_post_gap_file_txs: false, + post_gap_files_checked: false, transactions: Vec::new(), tx_id:0, dialect:0, @@ -933,6 +935,7 @@ impl SMBState { fn update_ts(&mut self, ts: u64) { if ts != self.ts { self.ts = ts; + self.post_gap_files_checked = false; } } @@ -1505,8 +1508,9 @@ impl SMBState { }; self.post_gap_housekeeping(STREAM_TOSERVER); - if self.check_post_gap_file_txs { + if self.check_post_gap_file_txs && !self.post_gap_files_checked { self.post_gap_housekeeping_for_files(); + self.post_gap_files_checked = true; } 0 } @@ -1735,8 +1739,9 @@ impl SMBState { } }; self.post_gap_housekeeping(STREAM_TOCLIENT); - if self.check_post_gap_file_txs { + if self.check_post_gap_file_txs && !self.post_gap_files_checked { self.post_gap_housekeeping_for_files(); + self.post_gap_files_checked = true; } self._debug_tx_stats(); 0