From: Victor Julien Date: Thu, 14 Nov 2013 14:57:04 +0000 (+0100) Subject: http & tls: fix transaction handling X-Git-Tag: suricata-2.0beta2~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36bc8d5cd0549b061dc4688a408592d1b147b465;p=thirdparty%2Fsuricata.git 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. --- 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: