From 2c3c8f8b85a0abd8bc12b546fcc9a77d084d6c0b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 25 Jan 2018 15:31:35 +0100 Subject: [PATCH] rust/filetracker: if file API return error, trunc file --- rust/src/filetracker.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rust/src/filetracker.rs b/rust/src/filetracker.rs index 9092599922..aa9acfa63a 100644 --- a/rust/src/filetracker.rs +++ b/rust/src/filetracker.rs @@ -212,7 +212,10 @@ impl FileTransferTracker { -2 => { self.file_is_truncated = true; }, - _ => { panic!("append failed with code {}", res); }, + _ => { + SCLogDebug!("got error so truncing file"); + self.file_is_truncated = true; + }, } self.tracked += self.chunk_left as u64; @@ -258,7 +261,8 @@ impl FileTransferTracker { self.file_is_truncated = true; }, _ => { - panic!("append failed: files.file_append() returned {}", res); + SCLogDebug!("got error so truncing file"); + self.file_is_truncated = true; }, } @@ -296,7 +300,10 @@ impl FileTransferTracker { -2 => { self.file_is_truncated = true; }, - _ => { panic!("append failed with code {}", res); }, + _ => { + SCLogDebug!("got error so truncing file"); + self.file_is_truncated = true; + }, } self.tracked += data.len() as u64; } else {