}
void OutputFiledataLogFfc(ThreadVars *tv, OutputFiledataLoggerThreadData *td, Packet *p,
- FileContainer *ffc, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
+ AppLayerGetFileState files, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
const uint8_t call_flags, const bool file_close, const bool file_trunc, const uint8_t dir)
{
- SCLogDebug("ffc %p", ffc);
+ SCLogDebug("ffc %p", files.fc);
OutputLoggerThreadStore *store = td->store;
- for (File *ff = ffc->head; ff != NULL; ff = ff->next) {
+ for (File *ff = files.fc->head; ff != NULL; ff = ff->next) {
FileApplyTxFlags(txd, dir, ff);
FilePrintFlags(ff);
* close the logger(s) */
if (FileDataSize(ff) == ff->content_stored && (file_trunc || file_close)) {
if (ff->state < FILE_STATE_CLOSED) {
- ff->state = FILE_STATE_TRUNCATED;
+ FileCloseFilePtr(ff, files.cfg, NULL, 0, FILE_TRUNCATED);
}
file_flags |= OUTPUT_FILEDATA_FLAG_CLOSE;
CallLoggers(tv, store, p, ff, txv, tx_id, NULL, 0, file_flags, dir);
/* 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, files.cfg, NULL, 0, FILE_TRUNCATED);
}
/* tell the logger we're closing up */
TmEcode OutputFiledataLogThreadDeinit(ThreadVars *tv, OutputFiledataLoggerThreadData *thread_data);
void OutputFiledataLogFfc(ThreadVars *tv, OutputFiledataLoggerThreadData *td, Packet *p,
- FileContainer *ffc, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
+ AppLayerGetFileState files, void *txv, const uint64_t tx_id, AppLayerTxData *txd,
const uint8_t call_flags, const bool file_close, const bool file_trunc, const uint8_t dir);
/** filedata logger function pointer type */
SCLogDebug("tx: calling files: ffc %p head %p file_close %d file_trunc %d", ffc, ffc->head,
file_close, file_trunc);
if (filedata_td && txd->files_opened > txd->files_stored)
- OutputFiledataLogFfc(tv, filedata_td, p, ffc, tx, tx_id, txd, packet_dir, file_close,
- file_trunc, packet_dir);
+ OutputFiledataLogFfc(tv, filedata_td, p, app_files, tx, tx_id, txd, packet_dir,
+ file_close, file_trunc, packet_dir);
if (file_td && txd->files_opened > txd->files_logged)
OutputFileLogFfc(
tv, file_td, p, ffc, tx, tx_id, txd, file_close, file_trunc, packet_dir);
SCLogDebug("tx: calling for opposing direction files: file_close:%s file_trunc:%s",
file_close ? "true" : "false", file_trunc ? "true" : "false");
if (filedata_td && txd->files_opened > txd->files_stored)
- OutputFiledataLogFfc(tv, filedata_td, p, ffc_opposing, tx, tx_id, txd, opposing_dir,
- file_close, file_trunc, opposing_dir);
+ OutputFiledataLogFfc(tv, filedata_td, p, app_files_opposing, tx, tx_id, txd,
+ opposing_dir, file_close, file_trunc, opposing_dir);
if (file_td && txd->files_opened > txd->files_logged)
OutputFileLogFfc(tv, file_td, p, ffc_opposing, tx, tx_id, txd, file_close, file_trunc,
opposing_dir);