From: Jason Ish Date: Wed, 13 Jul 2016 16:48:14 +0000 (-0600) Subject: logging: remove the packetqueue's from the logging path X-Git-Tag: suricata-3.2beta1~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55f2704a25876a1a9886a72f3057f7b5cf3ab8d7;p=thirdparty%2Fsuricata.git logging: remove the packetqueue's from the logging path They are not referenced by any loggers, and they probably shouldn't be either. --- diff --git a/src/flow-worker.c b/src/flow-worker.c index 2d981e4be7..89894c7199 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -191,7 +191,7 @@ TmEcode FlowWorker(ThreadVars *tv, Packet *p, void *data, PacketQueue *preq, Pac } // Outputs - OutputLoggerLog(tv, x, fw->output_thread, preq, unused); + OutputLoggerLog(tv, x, fw->output_thread); /* put these packets in the preq queue so that they are * by the other thread modules before packet 'p'. */ @@ -216,7 +216,7 @@ TmEcode FlowWorker(ThreadVars *tv, Packet *p, void *data, PacketQueue *preq, Pac } // Outputs. - OutputLoggerLog(tv, p, fw->output_thread, preq, unused); + OutputLoggerLog(tv, p, fw->output_thread); /* Release tcp segments. Done here after alerting can use them. */ if (p->flow != NULL && p->proto == IPPROTO_TCP) { diff --git a/src/output-file.c b/src/output-file.c index 402b398ab0..f43d63970f 100644 --- a/src/output-file.c +++ b/src/output-file.c @@ -90,7 +90,7 @@ int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc, return 0; } -static TmEcode OutputFileLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQueue *pq, PacketQueue *postpq) +static TmEcode OutputFileLog(ThreadVars *tv, Packet *p, void *thread_data) { BUG_ON(thread_data == NULL); diff --git a/src/output-filedata.c b/src/output-filedata.c index 589bef6893..50cff28162 100644 --- a/src/output-filedata.c +++ b/src/output-filedata.c @@ -124,7 +124,7 @@ static int CallLoggers(ThreadVars *tv, OutputLoggerThreadStore *store_list, return file_logged; } -static TmEcode OutputFiledataLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQueue *pq, PacketQueue *postpq) +static TmEcode OutputFiledataLog(ThreadVars *tv, Packet *p, void *thread_data) { BUG_ON(thread_data == NULL); diff --git a/src/output-packet.c b/src/output-packet.c index 3d18ad449c..fe4cc2fee8 100644 --- a/src/output-packet.c +++ b/src/output-packet.c @@ -90,7 +90,7 @@ int OutputRegisterPacketLogger(LoggerId logger_id, const char *name, return 0; } -static TmEcode OutputPacketLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQueue *pq, PacketQueue *postpq) +static TmEcode OutputPacketLog(ThreadVars *tv, Packet *p, void *thread_data) { BUG_ON(thread_data == NULL); diff --git a/src/output-streaming.c b/src/output-streaming.c index 1300295700..aae5ec5501 100644 --- a/src/output-streaming.c +++ b/src/output-streaming.c @@ -298,7 +298,7 @@ int StreamIterator(Flow *f, TcpStream *stream, int close, void *cbdata, uint8_t return 0; } -static TmEcode OutputStreamingLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQueue *pq, PacketQueue *postpq) +static TmEcode OutputStreamingLog(ThreadVars *tv, Packet *p, void *thread_data) { BUG_ON(thread_data == NULL); diff --git a/src/output-tx.c b/src/output-tx.c index ad24e5cb0c..339cd3b4fa 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -127,7 +127,7 @@ int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto, return 0; } -static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQueue *pq, PacketQueue *postpq) +static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data) { BUG_ON(thread_data == NULL); if (list == NULL) { diff --git a/src/output.c b/src/output.c index db742d4136..6c6ee8f805 100644 --- a/src/output.c +++ b/src/output.c @@ -916,15 +916,14 @@ void OutputNotifyFileRotation(void) { } } -TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data, - PacketQueue *pq, PacketQueue *postpq) +TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data) { LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data; RootLogger *logger = TAILQ_FIRST(&RootLoggers); LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store); while (logger && thread_store_node) { if (logger->LogFunc != NULL) { - logger->LogFunc(tv, p, thread_store_node->thread_data, pq, postpq); + logger->LogFunc(tv, p, thread_store_node->thread_data); } logger = TAILQ_NEXT(logger, entries); thread_store_node = TAILQ_NEXT(thread_store_node, entries); diff --git a/src/output.h b/src/output.h index 5d01c904ce..32004a6969 100644 --- a/src/output.h +++ b/src/output.h @@ -40,8 +40,8 @@ typedef OutputCtx *(*OutputInitFunc)(ConfNode *); typedef OutputCtx *(*OutputInitSubFunc)(ConfNode *, OutputCtx *); -typedef TmEcode (*OutputLogFunc)(ThreadVars *, Packet *, void *, PacketQueue *, - PacketQueue *); +typedef TmEcode (*OutputLogFunc)(ThreadVars *, Packet *, void *); + typedef struct OutputModule_ { LoggerId logger_id; const char *name; @@ -197,8 +197,7 @@ void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, OutputLogFunc LogFunc); void TmModuleLoggerRegister(void); -TmEcode OutputLoggerLog(ThreadVars *, Packet *, void *, PacketQueue *, - PacketQueue *); +TmEcode OutputLoggerLog(ThreadVars *, Packet *, void *); TmEcode OutputLoggerThreadInit(ThreadVars *, void *, void **); TmEcode OutputLoggerThreadDeinit(ThreadVars *, void *); void OutputLoggerExitPrintStats(ThreadVars *, void *);