From: Philippe Antoine Date: Wed, 1 Jul 2020 18:14:27 +0000 (+0200) Subject: files: rust closes files even on 0 length chunk X-Git-Tag: suricata-6.0.0-beta1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83567e8732669d6cd2b8f5a265abeeb2b4bda3e4;p=thirdparty%2Fsuricata.git files: rust closes files even on 0 length chunk --- diff --git a/rust/src/filetracker.rs b/rust/src/filetracker.rs index 233eefbedf..ad1402f66c 100644 --- a/rust/src/filetracker.rs +++ b/rust/src/filetracker.rs @@ -184,6 +184,11 @@ impl FileTransferTracker { if self.chunk_left + self.fill_bytes as u32 == 0 { //SCLogDebug!("UPDATE: nothing to do"); + if self.chunk_is_last == true { + SCLogDebug!("last empty chunk, closing"); + self.close(files, flags); + self.chunk_is_last = false; + } return 0 } else if self.chunk_left == 0 { SCLogDebug!("FILL BYTES {} from prev run", self.fill_bytes);