aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/mining.c
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2022-09-22 17:42:46 +0200
committerToni <matzeton@googlemail.com>2022-09-23 18:33:48 +0200
commit1f345b311f7f4bb3246a649ced3cec11d742b6e4 (patch)
treeaf829d9cfa5840f44d7207c2554107f65de55f47 /src/lib/protocols/mining.c
parent83de3e4716eb7dcc373f0fcad4b59e83ea140fb1 (diff)
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.
Diffstat (limited to 'src/lib/protocols/mining.c')
-rw-r--r--src/lib/protocols/mining.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/lib/protocols/mining.c b/src/lib/protocols/mining.c
index eb5e651d9..6d6e48f02 100644
--- a/src/lib/protocols/mining.c
+++ b/src/lib/protocols/mining.c
@@ -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);
}