output-streaming: remove ThreadExitPrintStats callback

Not used.

Ticket: #7227
pull/11689/head
Jason Ish 6 months ago committed by Victor Julien
parent a93bd8a387
commit 07d4d08665

@ -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_ {

@ -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,8 +431,7 @@ static uint32_t OutputStreamingLoggerGetActiveCount(void)
}
void OutputStreamingLoggerRegister(void) {
OutputRegisterRootLogger(OutputStreamingLogThreadInit,
OutputStreamingLogThreadDeinit, OutputStreamingLogExitPrintStats,
OutputRegisterRootLogger(OutputStreamingLogThreadInit, OutputStreamingLogThreadDeinit, NULL,
OutputStreamingLog, OutputStreamingLoggerGetActiveCount);
}

@ -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);

@ -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,
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)
{
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);

@ -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,

@ -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);
}

Loading…
Cancel
Save