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:
@@ -28,8 +28,6 @@
|
||||
|
||||
static void cacheMiningHostTwins(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int32_t host_keys /* network byte order */) {
|
||||
if(ndpi_struct->mining_cache == NULL) ndpi_struct->mining_cache = ndpi_lru_cache_init(1024);
|
||||
|
||||
if(ndpi_struct->mining_cache)
|
||||
ndpi_lru_add_to_cache(ndpi_struct->mining_cache, host_keys, NDPI_PROTOCOL_MINING);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user