]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log-tlslog: remove ThreadExitPrintStats callback
authorJason Ish <jason.ish@oisf.net>
Thu, 29 Aug 2024 20:35:50 +0000 (14:35 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 31 Aug 2024 08:53:59 +0000 (10:53 +0200)
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

index 3b4db18049d8a20be3a0ddf39d1bcc4356c7fe45..c9e17076abd08b84d237bcc5b8c1ad0eea96f7f8 100644 (file)
@@ -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);
 }