From 83567e8732669d6cd2b8f5a265abeeb2b4bda3e4 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 1 Jul 2020 20:14:27 +0200 Subject: [PATCH] files: rust closes files even on 0 length chunk --- rust/src/filetracker.rs | 5 +++++ 1 file changed, 5 insertions(+) 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);