From e62e4bdc4935305078cfdda7a3ef8045ca3e4b02 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 5 Dec 2018 22:07:53 +0100 Subject: [PATCH] app-layer: add debug statements to tx cleanup logic --- src/app-layer-parser.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 17f4a2a6d8..c9384c9667 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -866,11 +866,12 @@ FileContainer *AppLayerParserGetFiles(uint8_t ipproto, AppProto alproto, */ void AppLayerParserTransactionsCleanup(Flow *f) { + SCEnter(); DEBUG_ASSERT_FLOW_LOCKED(f); AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][f->alproto]; if (unlikely(p->StateTransactionFree == NULL)) - return; + SCReturn; const uint8_t ipproto = f->proto; const AppProto alproto = f->alproto; @@ -878,7 +879,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) AppLayerParserState * const alparser = f->alparser; if (alstate == NULL || alparser == NULL) - return; + SCReturn; const uint64_t min = alparser->min_id; const uint64_t total_txs = AppLayerParserGetTxCnt(f, alstate); @@ -891,6 +892,7 @@ void AppLayerParserTransactionsCleanup(Flow *f) memset(&state, 0, sizeof(state)); uint64_t i = min; uint64_t new_min = min; + SCLogDebug("start min %"PRIu64, min); while (1) { AppLayerGetTxIterTuple ires = IterFunc(ipproto, alproto, alstate, i, total_txs, &state); @@ -951,7 +953,7 @@ next: } /* see if we need to bring all trackers up to date. */ - SCLogDebug("update f->alparser->min_id? %"PRIu64, alparser->min_id); + SCLogDebug("update f->alparser->min_id? %"PRIu64" vs %"PRIu64, new_min, alparser->min_id); if (new_min > alparser->min_id) { const uint64_t next_id = new_min; alparser->min_id = next_id; @@ -960,6 +962,7 @@ next: alparser->log_id = MAX(alparser->log_id, next_id); SCLogDebug("updated f->alparser->min_id %"PRIu64, alparser->min_id); } + SCReturn; } #define IS_DISRUPTED(flags) \