From: Jason Ish Date: Wed, 2 Mar 2016 15:54:07 +0000 (-0600) Subject: alert-debuglog: trigger rotation on non-decoder events as well X-Git-Tag: suricata-3.0.1RC1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=160122205638127eddd8673d2bab46d297d62f4e;p=thirdparty%2Fsuricata.git alert-debuglog: trigger rotation on non-decoder events as well The write handling was missed for non-decoder events that would trigger rotation after a HUP. --- diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c index 5df1f4c1e9..43bbbf98bf 100644 --- a/src/alert-debuglog.c +++ b/src/alert-debuglog.c @@ -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);