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
-3
View File
@@ -58,9 +58,6 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
app_proto = NDPI_PROTOCOL_FACEBOOK_VOIP;
}
if(ndpi_struct->stun_cache == NULL)
ndpi_struct->stun_cache = ndpi_lru_cache_init(1024);
if(ndpi_struct->stun_cache
&& packet->iph
&& (app_proto != NDPI_PROTOCOL_UNKNOWN)