Skip to content

Commit f9adb16

Browse files
committed
++ cache
1 parent 0b3bd97 commit f9adb16

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

storage/cache.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ void NHTFlowCache::flush(Packet &pkt, size_t flow_index, int return_flags)
194194

195195
if (return_flags == ProcessPlugin::FlowAction::FLUSH_WITH_REINSERT) {
196196
#ifdef WITH_CTT
197-
send_export_request_to_ctt(m_flow_table[flow_index]->m_flow.flow_hash_ctt);
197+
if (m_flow_table[flow_index]->is_in_ctt) {
198+
m_flow_table[flow_index]->is_waiting_for_export = true;
199+
send_export_request_to_ctt(m_flow_table[flow_index]->m_flow.flow_hash_ctt);
200+
}
198201
#endif /* WITH_CTT */
199202
push_to_export_queue(flow_index);
200203
m_flow_table[flow_index]->m_flow.remove_extensions();
@@ -456,7 +459,9 @@ int NHTFlowCache::put_pkt(Packet &pkt)
456459
flow_index = row_begin + m_new_flow_insert_index;
457460
#ifdef WITH_CTT
458461
if (m_flow_table[flow_index.value()]->is_in_ctt){
459-
send_export_request_to_ctt(m_flow_table[flow_index.value()]->m_flow.flow_hash_ctt);
462+
m_flow_table[flow_index]->is_waiting_for_export = true;
463+
send_export_request_to_ctt(m_flow_table[flow_index]->m_flow.flow_hash_ctt);
464+
m_flow_table[flow_index]->export_time = {pkt.ts.tv_sec + 1, pkt.ts.tv_usec};
460465
}
461466
#endif /* WITH_CTT */
462467
plugins_pre_export(m_flow_table[flow_index.value()]->m_flow);

0 commit comments

Comments
 (0)