From a5a46795bd66e30cbd8e93a4cbf96514a6b9e702 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 21 Sep 2020 09:12:55 +0200 Subject: [PATCH] stream: make sure to call app-layer in case of depth reached --- src/stream-tcp-reassemble.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index b4aacf14fa..f39e1fcc56 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1129,6 +1129,9 @@ static int ReassembleUpdateAppLayer (ThreadVars *tv, break; continue; + } else if (flags & STREAM_DEPTH) { + // we're just called once with this flag, so make sure we pass it on + } else if (mydata == NULL || (mydata_len == 0 && ((flags & STREAM_EOF) == 0))) { /* Possibly a gap, but no new data. */ if ((p->flags & PKT_PSEUDO_STREAM_END) == 0 || ssn->state < TCP_CLOSED) @@ -1169,6 +1172,8 @@ static int ReassembleUpdateAppLayer (ThreadVars *tv, if (new_app_progress == app_progress || FlowChangeProto(p->flow)) break; app_progress = new_app_progress; + if (flags & STREAM_DEPTH) + break; } SCReturnInt(0);