Skip to content

Commit

Permalink
detect/tx: improve branch prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Jan 15, 2025
1 parent 8cec882 commit 35afa8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,14 +1340,14 @@ static DetectTransaction GetDetectTx(const uint8_t ipproto, const AppProto alpro
}
uint64_t detect_flags =
(flow_flags & STREAM_TOSERVER) ? txd->detect_flags_ts : txd->detect_flags_tc;
if (detect_flags & APP_LAYER_TX_INSPECTED_FLAG) {
if (unlikely(detect_flags & APP_LAYER_TX_INSPECTED_FLAG)) {
SCLogDebug("%"PRIu64" tx already fully inspected for %s. Flags %016"PRIx64,
tx_id, flow_flags & STREAM_TOSERVER ? "toserver" : "toclient",
detect_flags);
DetectTransaction no_tx = NO_TX;
return no_tx;
}
if (detect_flags & APP_LAYER_TX_SKIP_INSPECT_FLAG) {
if (unlikely(detect_flags & APP_LAYER_TX_SKIP_INSPECT_FLAG)) {
SCLogDebug("%" PRIu64 " tx should not be inspected in direction %s. Flags %016" PRIx64,
tx_id, flow_flags & STREAM_TOSERVER ? "toserver" : "toclient", detect_flags);
DetectTransaction no_tx = NO_TX;
Expand Down

0 comments on commit 35afa8f

Please sign in to comment.