rust/filetracker: remove reachable panic

Remove reachable panic condition when an existing file chunk is not
completed. Instead trunc the file and reset.

Related to bug #2717
pull/3561/head
Victor Julien 7 years ago
parent 1b1e136c4f
commit eedf08be29

@ -136,8 +136,10 @@ impl FileTransferTracker {
name: &[u8], data: &[u8], chunk_offset: u64, chunk_size: u32,
fill_bytes: u8, is_last: bool, xid: &u32) -> u32
{
if self.chunk_left != 0 { panic!("complete existing chunk first"); }
if self.fill_bytes != 0 { panic!("complete existing fill bytes first"); }
if self.chunk_left != 0 || self.fill_bytes != 0 {
SCLogDebug!("current chunk incomplete: truncating");
self.trunc(files, flags);
}
SCLogDebug!("NEW CHUNK: chunk_size {} fill_bytes {}", chunk_size, fill_bytes);

Loading…
Cancel
Save