* close the logger(s) */
if (FileDataSize(ff) == ff->content_stored &&
(file_trunc || file_close)) {
+ if (ff->state < FILE_STATE_CLOSED) {
+ FileCloseFilePtr(ff, NULL, 0, FILE_TRUNCATED);
+ }
CallLoggers(tv, store, p, ff, NULL, 0, OUTPUT_FILEDATA_FLAG_CLOSE);
ff->flags |= FILE_STORED;
continue;
/* if file needs to be closed or truncated, inform
* loggers */
if ((file_close || file_trunc) && ff->state < FILE_STATE_CLOSED) {
- ff->state = FILE_STATE_TRUNCATED;
+ FileCloseFilePtr(ff, NULL, 0, FILE_TRUNCATED);
}
/* tell the logger we're closing up */
return 0;
}
-static int FileCloseFilePtr(File *ff, const uint8_t *data,
+int FileCloseFilePtr(File *ff, const uint8_t *data,
uint32_t data_len, uint16_t flags)
{
SCEnter();
uint16_t flags);
int FileCloseFileById(FileContainer *, uint32_t track_id,
const uint8_t *data, uint32_t data_len, uint16_t flags);
+int FileCloseFilePtr(File *ff, const uint8_t *data,
+ uint32_t data_len, uint16_t flags);
/**
* \brief Store a chunk of file data in the flow. The open "flowfile"