From 6e660bd9bc8a9c670a751521c9c9e627c0926875 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 29 Aug 2024 14:35:50 -0600 Subject: [PATCH] log-tlslog: remove ThreadExitPrintStats callback Remove the ThreadExitPrintStats callback, this is the only logger that was actually using it, and this logger is marked for deprecation. This allows us to remove the callback from the registration signature. Ticket: #7227 --- src/log-tlslog.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/log-tlslog.c b/src/log-tlslog.c index 3b4db18049..c9e17076ab 100644 --- a/src/log-tlslog.c +++ b/src/log-tlslog.c @@ -83,11 +83,6 @@ typedef struct LogTlsFileCtx_ { typedef struct LogTlsLogThread_ { LogTlsFileCtx *tlslog_ctx; - - /* LogTlsFileCtx has the pointer to the file and a mutex to allow - multithreading. */ - uint32_t tls_cnt; - MemBuffer *buffer; } LogTlsLogThread; @@ -185,16 +180,6 @@ static void LogTlsLogDeInitCtx(OutputCtx *output_ctx) SCFree(output_ctx); } -static void LogTlsLogExitPrintStats(ThreadVars *tv, void *data) -{ - LogTlsLogThread *aft = (LogTlsLogThread *)data; - if (aft == NULL) { - return; - } - - SCLogInfo("TLS logger logged %" PRIu32 " requests", aft->tls_cnt); -} - /** \brief Create a new tls log LogFileCtx. * \param conf Pointer to ConfNode containing this loggers configuration. * \return NULL if failure, LogFileCtx* to the file_ctx if succesful @@ -514,8 +499,6 @@ static int LogTlsLogger(ThreadVars *tv, void *thread_data, const Packet *p, MemBufferWriteString(aft->buffer, "\n"); - aft->tls_cnt++; - hlog->file_ctx->Write((const char *)MEMBUFFER_BUFFER(aft->buffer), MEMBUFFER_OFFSET(aft->buffer), hlog->file_ctx); @@ -524,8 +507,7 @@ static int LogTlsLogger(ThreadVars *tv, void *thread_data, const Packet *p, void LogTlsLogRegister(void) { - OutputRegisterTxModuleWithProgress(LOGGER_TLS, MODULE_NAME, "tls-log", - LogTlsLogInitCtx, ALPROTO_TLS, LogTlsLogger, TLS_HANDSHAKE_DONE, - TLS_HANDSHAKE_DONE, LogTlsLogThreadInit, LogTlsLogThreadDeinit, - LogTlsLogExitPrintStats); + OutputRegisterTxModuleWithProgress(LOGGER_TLS, MODULE_NAME, "tls-log", LogTlsLogInitCtx, + ALPROTO_TLS, LogTlsLogger, TLS_HANDSHAKE_DONE, TLS_HANDSHAKE_DONE, LogTlsLogThreadInit, + LogTlsLogThreadDeinit, NULL); } -- 2.47.2