Sizes of LRU caches are now configurable

0 as size value disable the cache.

The diffs in unit tests are due to the fact that some lookups are
performed before the first insert: before this change these lookups
weren't counted because the cache was not yet initialized, now they are.
This commit is contained in:
Nardi Ivan
2022-09-23 18:33:48 +02:00
committed by Toni
parent 83de3e4716
commit 1f345b311f
133 changed files with 345 additions and 232 deletions
+4
View File
@@ -2427,6 +2427,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 */
ndpi_set_lru_cache_size(ndpi_thread_info[thread_id].workflow->ndpi_struct,
NDPI_LRUCACHE_BITTORRENT, 32768);
ndpi_finalize_initialization(ndpi_thread_info[thread_id].workflow->ndpi_struct);
if(enable_doh_dot_detection)