tls-log: fix so buffer is reset on custom logging

Move MemBufferReset() so it also works when using custom tls
logging. This avoids duplicate tls log entries.

Bug #3177
pull/4236/head
Mats Klepsland 7 years ago committed by Victor Julien
parent af4f816204
commit 85536e8918

@ -451,12 +451,12 @@ static int LogTlsLogger(ThreadVars *tv, void *thread_data, const Packet *p,
return 0; return 0;
} }
MemBufferReset(aft->buffer);
/* Custom format */ /* Custom format */
if (hlog->flags & LOG_TLS_CUSTOM) { if (hlog->flags & LOG_TLS_CUSTOM) {
LogTlsLogCustom(aft, ssl_state, &p->ts, srcip, sp, dstip, dp); LogTlsLogCustom(aft, ssl_state, &p->ts, srcip, sp, dstip, dp);
} else { } else {
MemBufferReset(aft->buffer);
CreateTimeString(&p->ts, timebuf, sizeof(timebuf)); CreateTimeString(&p->ts, timebuf, sizeof(timebuf));
MemBufferWriteString(aft->buffer, MemBufferWriteString(aft->buffer,
"%s %s:%d -> %s:%d TLS:", "%s %s:%d -> %s:%d TLS:",

Loading…
Cancel
Save