diff --git a/src/log-tcp-data.c b/src/log-tcp-data.c index 9c67497c16..a801c89978 100644 --- a/src/log-tcp-data.c +++ b/src/log-tcp-data.c @@ -44,12 +44,12 @@ static void LogTcpDataLogDeInitCtx(OutputCtx *); int LogTcpDataLogger(ThreadVars *tv, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags); void LogTcpDataLogRegister (void) { - OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "tcp-data", - LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_TCP_DATA, - LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); + OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "tcp-data", LogTcpDataLogInitCtx, + LogTcpDataLogger, STREAMING_TCP_DATA, LogTcpDataLogThreadInit, + LogTcpDataLogThreadDeinit); OutputRegisterStreamingModule(LOGGER_TCP_DATA, MODULE_NAME, "http-body-data", - LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_HTTP_BODIES, - LogTcpDataLogThreadInit, LogTcpDataLogThreadDeinit, NULL); + LogTcpDataLogInitCtx, LogTcpDataLogger, STREAMING_HTTP_BODIES, LogTcpDataLogThreadInit, + LogTcpDataLogThreadDeinit); } typedef struct LogTcpDataFileCtx_ { diff --git a/src/output-streaming.c b/src/output-streaming.c index 3a7cefca23..8c1d54888f 100644 --- a/src/output-streaming.c +++ b/src/output-streaming.c @@ -56,16 +56,13 @@ typedef struct OutputStreamingLogger_ { enum OutputStreamingType type; ThreadInitFunc ThreadInit; ThreadDeinitFunc ThreadDeinit; - ThreadExitPrintStatsFunc ThreadExitPrintStats; } OutputStreamingLogger; static OutputStreamingLogger *list = NULL; -int OutputRegisterStreamingLogger(LoggerId id, const char *name, - StreamingLogger LogFunc, OutputCtx *output_ctx, - enum OutputStreamingType type, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats) +int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc, + OutputCtx *output_ctx, enum OutputStreamingType type, ThreadInitFunc ThreadInit, + ThreadDeinitFunc ThreadDeinit) { OutputStreamingLogger *op = SCCalloc(1, sizeof(*op)); if (op == NULL) @@ -78,7 +75,6 @@ int OutputRegisterStreamingLogger(LoggerId id, const char *name, op->type = type; op->ThreadInit = ThreadInit; op->ThreadDeinit = ThreadDeinit; - op->ThreadExitPrintStats = ThreadExitPrintStats; if (list == NULL) list = op; @@ -425,22 +421,6 @@ static TmEcode OutputStreamingLogThreadDeinit(ThreadVars *tv, void *thread_data) return TM_ECODE_OK; } -static void OutputStreamingLogExitPrintStats(ThreadVars *tv, void *thread_data) { - OutputStreamingLoggerThreadData *op_thread_data = - (OutputStreamingLoggerThreadData *)thread_data; - OutputLoggerThreadStore *store = op_thread_data->store; - OutputStreamingLogger *logger = list; - - while (logger && store) { - if (logger->ThreadExitPrintStats) { - logger->ThreadExitPrintStats(tv, store->thread_data); - } - - logger = logger->next; - store = store->next; - } -} - static uint32_t OutputStreamingLoggerGetActiveCount(void) { uint32_t cnt = 0; @@ -451,9 +431,8 @@ static uint32_t OutputStreamingLoggerGetActiveCount(void) } void OutputStreamingLoggerRegister(void) { - OutputRegisterRootLogger(OutputStreamingLogThreadInit, - OutputStreamingLogThreadDeinit, OutputStreamingLogExitPrintStats, - OutputStreamingLog, OutputStreamingLoggerGetActiveCount); + OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, NULL, + OutputStreamingLog, OutputStreamingLoggerGetActiveCount); } void OutputStreamingShutdown(void) diff --git a/src/output-streaming.h b/src/output-streaming.h index 91c89f1941..40633e02b4 100644 --- a/src/output-streaming.h +++ b/src/output-streaming.h @@ -42,10 +42,9 @@ typedef int (*StreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags); -int OutputRegisterStreamingLogger(LoggerId id, const char *name, - StreamingLogger LogFunc, OutputCtx *, enum OutputStreamingType, - ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats); +int OutputRegisterStreamingLogger(LoggerId id, const char *name, StreamingLogger LogFunc, + OutputCtx *, enum OutputStreamingType, ThreadInitFunc ThreadInit, + ThreadDeinitFunc ThreadDeinit); void OutputStreamingLoggerRegister (void); diff --git a/src/output.c b/src/output.c index da984aec51..33e82d60a7 100644 --- a/src/output.c +++ b/src/output.c @@ -501,12 +501,10 @@ error: * * \retval Returns 0 on success, -1 on failure. */ -void OutputRegisterStreamingModule(LoggerId id, const char *name, - const char *conf_name, OutputInitFunc InitFunc, - StreamingLogger StreamingLogFunc, - enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, - ThreadExitPrintStatsFunc ThreadExitPrintStats) +void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, + OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc, + enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, + ThreadDeinitFunc ThreadDeinit) { if (unlikely(StreamingLogFunc == NULL)) { goto error; @@ -525,7 +523,6 @@ void OutputRegisterStreamingModule(LoggerId id, const char *name, module->stream_type = stream_type; module->ThreadInit = ThreadInit; module->ThreadDeinit = ThreadDeinit; - module->ThreadExitPrintStats = ThreadExitPrintStats; TAILQ_INSERT_TAIL(&output_modules, module, entries); SCLogDebug("Streaming logger \"%s\" registered.", name); diff --git a/src/output.h b/src/output.h index 81ed9394bf..d393ff4182 100644 --- a/src/output.h +++ b/src/output.h @@ -131,7 +131,7 @@ void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const cha void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit, - ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats); + ThreadDeinitFunc ThreadDeinit); void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, diff --git a/src/runmodes.c b/src/runmodes.c index 3ad5f865ab..ae844fc086 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -641,10 +641,8 @@ static void SetupOutput( file_logger_count++; } else if (module->StreamingLogFunc) { SCLogDebug("%s is a streaming logger", module->name); - OutputRegisterStreamingLogger(module->logger_id, module->name, - module->StreamingLogFunc, output_ctx, module->stream_type, - module->ThreadInit, module->ThreadDeinit, - module->ThreadExitPrintStats); + OutputRegisterStreamingLogger(module->logger_id, module->name, module->StreamingLogFunc, + output_ctx, module->stream_type, module->ThreadInit, module->ThreadDeinit); } else { SCLogError("Unknown logger type: name=%s", module->name); }