LRU caches: add a generic (optional and configurable) expiration logic (#1855)

Two caches already implemented a similar mechanism: make it generic.
This commit is contained in:
Ivan Nardi
2023-01-18 18:18:36 +01:00
committed by GitHub
parent de24206adc
commit 1b98bec0ab
12 changed files with 196 additions and 63 deletions
+2 -1
View File
@@ -2477,9 +2477,10 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
if(_maliciousSHA1Path)
ndpi_load_malicious_sha1_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _maliciousSHA1Path);
/* Enable/disable/configure LRU caches here */
/* Enable/disable/configure LRU caches size here */
ndpi_set_lru_cache_size(ndpi_thread_info[thread_id].workflow->ndpi_struct,
NDPI_LRUCACHE_BITTORRENT, 32768);
/* Enable/disable LRU caches TTL here */
ndpi_finalize_initialization(ndpi_thread_info[thread_id].workflow->ndpi_struct);