DetectEngineStateDirection *dir_state = &f->de_state->dir_state[flags & STREAM_TOSERVER ? 0 : 1];
DeStateStore *store = dir_state->head;
+ void *inspect_tx = NULL;
uint64_t inspect_tx_id = 0;
uint64_t total_txs = 0;
uint8_t alproto_supports_txs = 0;
DeStateResetFileInspection(f, alproto, alstate, flags);
if (AppLayerAlprotoSupportsTxs(alproto)) {
+ FLOWLOCK_RDLOCK(f);
inspect_tx_id = AppLayerTransactionGetInspectId(f, flags);
total_txs = AppLayerGetTxCnt(alproto, alstate);
+ FLOWLOCK_UNLOCK(f);
alproto_supports_txs = 1;
}
}
engine = app_inspection_engine[alproto][(flags & STREAM_TOSERVER) ? 0 : 1];
- void *inspect_tx = AppLayerGetTx(alproto, alstate, inspect_tx_id);
- if (inspect_tx == NULL) {
- FLOWLOCK_UNLOCK(f);
- goto end;
- }
+ inspect_tx = AppLayerGetTx(alproto, alstate, inspect_tx_id);
+ if (inspect_tx == NULL)
+ continue;
while (engine != NULL) {
if (!(item->flags & engine->inspect_flags) &&
s->sm_lists[engine->sm_list] != NULL)
#include "util-unittest-helper.h"
#include "app-layer.h"
+#include "app-layer-parser.h"
#include "stream-tcp.h"
FLOWLOCK_RDLOCK(p->flow);
HtpState *htp_state = p->flow->alstate;
if (htp_state != NULL && htp_state->connp != NULL && htp_state->connp->conn != NULL) {
- uint64_t idx = AppLayerTransactionGetInspectId(p->flow, flags);
- if (idx != -1) {
- htp_tx_t *tx = NULL;
-
- uint64_t total_txs= AppLayerGetNoOfTxs(ALPROTO_HTTP, htp_state);
- for ( ; idx < size; idx++)
- {
- tx = AppLayerGetTx(http_state, idx);
- if (tx == NULL)
- continue;
-
- if ((tluajit->flags & DATATYPE_HTTP_REQUEST_LINE) && tx->request_line != NULL &&
- bstr_len(tx->request_line) > 0) {
- lua_pushliteral(tluajit->luastate, "http.request_line"); /* stack at -2 */
- lua_pushlstring (tluajit->luastate,
- (const char *)bstr_ptr(tx->request_line),
- bstr_len(tx->request_line));
- lua_settable(tluajit->luastate, -3);
- }
+ htp_tx_t *tx = NULL;
+ uint64_t idx = AppLayerTransactionGetInspectId(p->flow, 0);
+ uint64_t total_txs= AppLayerGetTxCnt(ALPROTO_HTTP, htp_state);
+ for ( ; idx < total_txs; idx++) {
+ tx = AppLayerGetTx(ALPROTO_HTTP, htp_state, idx);
+ if (tx == NULL)
+ continue;
+
+ if ((tluajit->flags & DATATYPE_HTTP_REQUEST_LINE) && tx->request_line != NULL &&
+ bstr_len(tx->request_line) > 0) {
+ lua_pushliteral(tluajit->luastate, "http.request_line"); /* stack at -2 */
+ lua_pushlstring (tluajit->luastate,
+ (const char *)bstr_ptr(tx->request_line),
+ bstr_len(tx->request_line));
+ lua_settable(tluajit->luastate, -3);
}
}
}