From 839a4f5ab47350b5c3ef6aed4d9fa3f04911c0c9 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 21 Sep 2022 09:34:08 +0200 Subject: [PATCH] files: only call loggers is there is work to do --- src/output-tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/output-tx.c b/src/output-tx.c index 3b4e55a6ed..708c449a7c 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -189,10 +189,10 @@ static inline void OutputTxLogFiles(ThreadVars *tv, OutputFileLoggerThreadData * const bool file_trunc = StreamTcpReassembleDepthReached(p) | eof; SCLogDebug("tx: calling files: ffc %p head %p file_close %d file_trunc %d", ffc, ffc->head, file_close, file_trunc); - if (filedata_td) + 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); - if (file_td) + 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); } @@ -203,10 +203,10 @@ static inline void OutputTxLogFiles(ThreadVars *tv, OutputFileLoggerThreadData * opposing_finished = true; SCLogDebug("tx: calling for opposing direction files: file_close:%s file_trunc:%s", file_close ? "true" : "false", file_trunc ? "true" : "false"); - if (filedata_td) + 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); - if (file_td) + 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); }