From 7bddd0e168ef6efef7caec5874c1b179295ece61 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 1 Mar 2017 16:51:22 +0100 Subject: [PATCH] stream: improve --disable-detection GAP handling --- src/stream-tcp-list.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stream-tcp-list.c b/src/stream-tcp-list.c index a532c3cb10..ce35bc04fe 100644 --- a/src/stream-tcp-list.c +++ b/src/stream-tcp-list.c @@ -586,7 +586,7 @@ int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ static inline int SegmentInUse(TcpSession *ssn, TcpStream *stream, TcpSegment *seg) { /* if proto detect isn't done, we're not returning */ - if (!(stream->flags & STREAMTCP_STREAM_FLAG_GAP)) { + if (!(stream->flags & (STREAMTCP_STREAM_FLAG_GAP|STREAMTCP_STREAM_FLAG_NOREASSEMBLY))) { if (!(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(stream))) { SCReturnInt(1); } @@ -756,8 +756,9 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) StreamingBufferClear(&stream->sb); return; - } else if ((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) && - (stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW)) + } else if (((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) || + (stream->flags & STREAMTCP_STREAM_FLAG_GAP)) && + (stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW)) { SCLogDebug("ssn %p: both app and raw are done, " "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn);