From: Victor Julien Date: Wed, 8 Mar 2017 11:52:56 +0000 (+0100) Subject: stream: debug improvements X-Git-Tag: suricata-4.0.0-beta1~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f7cb2b553bd06bb04f383c44f3ba055c917124;p=thirdparty%2Fsuricata.git stream: debug improvements --- diff --git a/src/stream-tcp-list.c b/src/stream-tcp-list.c index ce35bc04fe..2a739c25c1 100644 --- a/src/stream-tcp-list.c +++ b/src/stream-tcp-list.c @@ -750,8 +750,8 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) if (stream->flags & STREAMTCP_STREAM_FLAG_DEPTH_REACHED) { stream->flags |= STREAMTCP_STREAM_FLAG_NOREASSEMBLY; - SCLogDebug("ssn %p: reassembly depth reached, " - "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn); + SCLogDebug("ssn %p / stream %p: reassembly depth reached, " + "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream); StreamTcpReturnStreamSegments(stream); StreamingBufferClear(&stream->sb); return; @@ -760,8 +760,8 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) (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); + SCLogDebug("ssn %p / stream %p: both app and raw are done, " + "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream); stream->flags |= STREAMTCP_STREAM_FLAG_NOREASSEMBLY; StreamTcpReturnStreamSegments(stream); StreamingBufferClear(&stream->sb); diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 5d4a067bc4..1fef7b233e 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1706,7 +1706,13 @@ int StreamTcpReassembleHandleSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ SCReturnInt(-1); } + SCLogDebug("packet %"PRIu64" set PKT_STREAM_ADD", p->pcap_cnt); p->flags |= PKT_STREAM_ADD; + } else { + SCLogDebug("ssn %p / stream %p: not calling StreamTcpReassembleHandleSegmentHandleData:" + " p->payload_len %u, STREAMTCP_STREAM_FLAG_NOREASSEMBLY %s", + ssn, stream, p->payload_len, + (stream->flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) ? "true" : "false"); } /* in stream inline mode even if we have no data we call the reassembly