Skip to content

Commit b91f5bb

Browse files
committed
++ cache
1 parent 7f1d4b2 commit b91f5bb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

storage/cache.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,7 @@ int NHTFlowCache::process_flow(Packet& packet, size_t flow_index, size_t hash_va
296296
return 0;
297297
}
298298
}
299-
300-
if (m_flow_table[flow_index]->is_empty()) {
301-
create_record(packet, flow_index, hash_value);
302-
export_expired(packet.ts);
303-
return 0;
304-
}
299+
305300
/* Check if flow record is expired (inactive timeout). */
306301
if (!flow_is_waiting_for_export
307302
&& try_to_export_on_inactive_timeout(flow_index, packet.ts)) {
@@ -418,7 +413,9 @@ int NHTFlowCache::put_pkt(Packet &pkt)
418413

419414
row_span.advance_flow(flow_index.value());
420415
flow_index = row_begin;
421-
return process_flow(pkt, flow_index.value(), hash_value.value(), flow_is_waiting_for_export);
416+
create_record(pkt, flow_index.value(), hash_value.value());
417+
export_expired(pkt.ts);
418+
return 0;
422419
}
423420
/* Existing flow record was not found. Find free place in flow line. */
424421
const std::optional<size_t> empty_index = row_span.find_empty();

0 commit comments

Comments
 (0)