From 36bc8d5cd0549b061dc4688a408592d1b147b465 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 14 Nov 2013 15:57:04 +0100 Subject: [PATCH] http & tls: fix transaction handling When http and/or tls logging is disabled, the app layer would still be flagged as logging. This caused transactions not to be freed until the end of the flow as the logged tx id would never increment. This fix postpones the setting of the app layer parser "logger" flag to the point where we know the logger is enabled. --- src/log-httplog.c | 6 +++--- src/log-tlslog.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/log-httplog.c b/src/log-httplog.c index c6383d65c9..6c1f1231cf 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -73,9 +73,6 @@ void TmModuleLogHttpLogRegister (void) { tmm_modules[TMM_LOGHTTPLOG].cap_flags = 0; OutputRegisterModule(MODULE_NAME, "http-log", LogHttpLogInitCtx); - - /* enable the logger for the app layer */ - AppLayerRegisterLogger(ALPROTO_HTTP); } void TmModuleLogHttpLogIPv4Register (void) { @@ -790,6 +787,9 @@ OutputCtx *LogHttpLogInitCtx(ConfNode *conf) SCLogDebug("HTTP log output initialized"); + /* enable the logger for the app layer */ + AppLayerRegisterLogger(ALPROTO_HTTP); + return output_ctx; parsererror: diff --git a/src/log-tlslog.c b/src/log-tlslog.c index 6b3b31d1f3..67876849cf 100644 --- a/src/log-tlslog.c +++ b/src/log-tlslog.c @@ -83,9 +83,6 @@ void TmModuleLogTlsLogRegister(void) OutputRegisterModule(MODULE_NAME, "tls-log", LogTlsLogInitCtx); - /* enable the logger for the app layer */ - AppLayerRegisterLogger(ALPROTO_TLS); - SC_ATOMIC_INIT(cert_id); } @@ -593,6 +590,9 @@ OutputCtx *LogTlsLogInitCtx(ConfNode *conf) SCLogDebug("TLS log output initialized"); + /* enable the logger for the app layer */ + AppLayerRegisterLogger(ALPROTO_TLS); + return output_ctx; tlslog_error: