From 1f345b311f7f4bb3246a649ced3cec11d742b6e4 Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Thu, 22 Sep 2022 17:42:46 +0200 Subject: 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. --- src/lib/protocols/ookla.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/lib/protocols/ookla.c') diff --git a/src/lib/protocols/ookla.c b/src/lib/protocols/ookla.c index 5f4c170bf..a57231c30 100644 --- a/src/lib/protocols/ookla.c +++ b/src/lib/protocols/ookla.c @@ -56,9 +56,6 @@ void ndpi_search_ookla(struct ndpi_detection_module_struct* ndpi_struct, struct && (packet->payload[2] == 0x0A)) { ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI); - if(ndpi_struct->ookla_cache == NULL) - ndpi_struct->ookla_cache = ndpi_lru_cache_init(1024); - if(ndpi_struct->ookla_cache != NULL) { /* In order to avoid creating an IPv6 LRU we hash the IPv6 address */ h = ndpi_quick_hash((unsigned char *)&packet->iphv6->ip6_dst, sizeof(packet->iphv6->ip6_dst)); -- cgit v1.2.3