]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http & tls: fix transaction handling
authorVictor Julien <victor@inliniac.net>
Thu, 14 Nov 2013 14:57:04 +0000 (15:57 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 15 Nov 2013 14:41:24 +0000 (15:41 +0100)
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
src/log-tlslog.c

index c6383d65c9271370a7671ef2634e287895139c1d..6c1f1231cfe911567a24de1dde2bc353dad040ba 100644 (file)
@@ -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:
index 6b3b31d1f32a18711694a7cfbdff24a5fc6029d5..67876849cf67ba33cce749b1c01042fbf598ef38 100644 (file)
@@ -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: