Skip to content

Commit 3d0345d

Browse files
committed
eve/frame: require frame length to be known
Or reach logging threshold. Avoids logging too early.
1 parent 3290cc4 commit 3d0345d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/output-json-frame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ static int FrameJson(ThreadVars *tv, JsonFrameLogThread *aft, const Packet *p)
369369
int64_t abs_offset = (int64_t)frame->offset + (int64_t)STREAM_BASE_OFFSET(stream);
370370
int64_t win = STREAM_APP_PROGRESS(stream) - abs_offset;
371371

372-
if (!eof && win < frame->len && win < 2500) {
372+
/* skip frame if threshold not yet reached, esp if frame length is
373+
* still unknown. */
374+
if (!eof && ((frame->len == -1) || (win < frame->len)) && win < 2500) {
373375
SCLogDebug("frame id %" PRIi64 " len %" PRIi64 ", win %" PRIi64
374376
", skipping logging",
375377
frame->id, frame->len, win);

0 commit comments

Comments
 (0)