Since
ebcc4db84ac2c1957a6cc23b5154d7d6333f4cb8 the flow worker runs
file pruning after parsing, detection and loging. This means we can
simplify the pruning logic. If a file is in state >= CLOSED, we can
prune it. Detection and outputs will have had a final chance to
process it.
Remove the calls to the pruning code from Rust. They are no longer
needed.
}
self.file_open = false;
self.tracked = 0;
- files.files_prune();
}
pub fn trunc (&mut self, files: &mut FileContainer, flags: u16) {
let myflags = flags | 1; // TODO util-file.c::FILE_TRUNCATED
files.file_close(&self.track_id, myflags);
SCLogDebug!("truncated file");
- files.files_prune();
self.file_is_truncated = true;
}
consumed += data.len();
}
}
- files.files_prune();
consumed as u32
}
SCLogDebug("file->state %d. Is >= FILE_STATE_CLOSED: %s", file->state, (file->state >= FILE_STATE_CLOSED) ? "yes" : "no");
/* file is done when state is closed+, logging/storing is done (if any) */
- if (file->state >= FILE_STATE_CLOSED &&
- (!RunModeOutputFileEnabled() || (file->flags & FILE_LOGGED)) &&
- (!RunModeOutputFiledataEnabled() || (file->flags & (FILE_STORED|FILE_NOSTORE))))
- {
+ if (file->state >= FILE_STATE_CLOSED) {
SCReturnInt(1);
} else {
SCReturnInt(0);