]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
alert-debuglog: trigger rotation on non-decoder events as well
authorJason Ish <ish@unx.ca>
Wed, 2 Mar 2016 15:54:07 +0000 (09:54 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 3 Mar 2016 12:07:26 +0000 (13:07 +0100)
The write handling was missed for non-decoder events that
would trigger rotation after a HUP.

src/alert-debuglog.c

index 5df1f4c1e9f5ed9b15bfb29a06c8807f6cab609e..43bbbf98bf1e654f7dc235f666f94ae069198a24 100644 (file)
@@ -321,8 +321,8 @@ static TmEcode AlertDebugLogger(ThreadVars *tv, const Packet *p, void *thread_da
     }
 
     SCMutexLock(&aft->file_ctx->fp_mutex);
-    (void)MemBufferPrintToFPAsString(aft->buffer, aft->file_ctx->fp);
-    fflush(aft->file_ctx->fp);
+    aft->file_ctx->Write((const char *)MEMBUFFER_BUFFER(aft->buffer),
+        MEMBUFFER_OFFSET(aft->buffer), aft->file_ctx);
     aft->file_ctx->alerts += p->alerts.cnt;
     SCMutexUnlock(&aft->file_ctx->fp_mutex);