From: Victor Julien Date: Mon, 5 Jan 2015 12:17:51 +0000 (+0100) Subject: smtp: fix tx handling X-Git-Tag: suricata-2.1beta3~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f32d79dfe0ce98cbfc793a3e9ed78278315d70c3;p=thirdparty%2Fsuricata.git smtp: fix tx handling Fix issue where SMTPStateGetTxCnt would return the actual active tx'. The 'GetCnt' API call is not named correctly. It should be 'GetMaxId', as this is actually the expected behavior. --- diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 414a6e6721..91dd244c20 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1254,20 +1254,13 @@ static void SMTPStateTransactionFree (void *state, uint64_t tx_id) } -/** \todo slow */ +/** \retval cnt highest tx id */ static uint64_t SMTPStateGetTxCnt(void *state) { uint64_t cnt = 0; SMTPState *smtp_state = state; if (smtp_state) { - SMTPTransaction *tx = NULL; - - if (smtp_state->curr_tx == NULL) - return 0ULL; - - TAILQ_FOREACH(tx, &smtp_state->tx_list, next) { - cnt++; - } + cnt = smtp_state->tx_cnt; } SCLogDebug("returning %"PRIu64, cnt); return cnt;