]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
debug: make it easier to trace flush logic
authorVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 10:47:10 +0000 (12:47 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 12:56:22 +0000 (14:56 +0200)
src/detect-engine-payload.c
src/detect-engine.c
src/detect.c
src/stream-tcp-reassemble.c

index add1ba6a3d9d7f0d1a623bae9b22429b02cec606..a5752464bea61e666667ff3fae5e4b1c7e8a7df1 100644 (file)
@@ -265,7 +265,7 @@ int DetectEngineInspectStreamPayload(DetectEngineCtx *de_ctx,
         Flow *f, Packet *p)
 {
     SCEnter();
-
+    SCLogDebug("FLUSH? %s", (s->flags & SIG_FLAG_FLUSH)?"true":"false");
     uint64_t unused;
     struct StreamContentInspectData inspect_data = { de_ctx, det_ctx, s, f };
     int r = StreamReassembleRaw(f->protoctx, p,
@@ -334,8 +334,9 @@ int DetectEngineInspectStream(ThreadVars *tv,
     if (ssn == NULL)
         return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH;
 
-    SCLogDebug("pre-inspect det_ctx->raw_stream_progress %"PRIu64,
-            det_ctx->raw_stream_progress);
+    SCLogDebug("pre-inspect det_ctx->raw_stream_progress %"PRIu64" FLUSH? %s",
+            det_ctx->raw_stream_progress,
+            (s->flags & SIG_FLAG_FLUSH)?"true":"false");
     uint64_t unused;
     struct StreamContentInspectEngineData inspect_data = { de_ctx, det_ctx, s, smd, f };
     int match = StreamReassembleRaw(f->protoctx, p,
index c2e43b1471bd20485564cc125bade03a50096cd6..78cc2248c2c75f49058effbb6516f45523c60a2e 100644 (file)
@@ -630,6 +630,7 @@ next:
         }
 
         if (s->init_data->init_flags & SIG_FLAG_INIT_NEED_FLUSH) {
+            SCLogDebug("set SIG_FLAG_FLUSH on %u", s->id);
             s->flags |= SIG_FLAG_FLUSH;
         }
     }
index 890c743f2b2ab4b64bb22de36a02fcc25ab03a66..5cac567fffadda27b5acc5fda0fe1c3e76c79417 100644 (file)
@@ -1072,6 +1072,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv,
         flow_flags &=~ STREAM_FLUSH;
 
     TRACE_SID_TXS(s->id, tx, "starting %s", direction ? "toclient" : "toserver");
+    TRACE_SID_TXS(s->id, tx, "FLUSH? %s", (flow_flags & STREAM_FLUSH)?"true":"false");
 
     /* for a new inspection we inspect pkt header and packet matches */
     if (likely(stored_flags == NULL)) {
index 647b0d4145eda21f52b27b90486630e680b5ce1e..d8e16b44162fecfa5032a152093991cad89eda14 100644 (file)
@@ -1534,6 +1534,12 @@ static int StreamReassembleRawDo(TcpSession *ssn, TcpStream *stream,
      * use a minimal inspect depth, we actually take the app progress
      * as that is the right edge of the data. Then we take the window
      * of 'min_inspect_depth' before that. */
+
+    SCLogDebug("respect_inspect_depth %s STREAMTCP_STREAM_FLAG_TRIGGER_RAW %s stream->min_inspect_depth %u",
+            respect_inspect_depth ? "true" : "false",
+            (stream->flags & STREAMTCP_STREAM_FLAG_TRIGGER_RAW) ? "true" : "false",
+            stream->min_inspect_depth);
+
     if (respect_inspect_depth &&
         (stream->flags & STREAMTCP_STREAM_FLAG_TRIGGER_RAW)
         && stream->min_inspect_depth)