diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-01-18 18:18:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 18:18:36 +0100 |
commit | 1b98bec0abb61fb86180a13869434da8519bd261 (patch) | |
tree | fce6f0e35e87b1f7027d319e5645b0907e3fde94 /src/lib/protocols/http.c | |
parent | de24206adccf2347addc05d6d62b3bf743fef411 (diff) |
LRU caches: add a generic (optional and configurable) expiration logic (#1855)
Two caches already implemented a similar mechanism: make it generic.
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 50df30830..b9cc198c1 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -1255,9 +1255,9 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct if(ndpi_struct->ookla_cache != NULL) { if(packet->iph != NULL) { if(packet->tcp->source == htons(8080)) - ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, packet->iph->saddr, 1 /* dummy */); + ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, packet->iph->saddr, 1 /* dummy */, ndpi_get_current_time(flow)); else - ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, packet->iph->daddr, 1 /* dummy */); + ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, packet->iph->daddr, 1 /* dummy */, ndpi_get_current_time(flow)); } else if(packet->iphv6 != NULL) { u_int32_t h; @@ -1266,7 +1266,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct else h = ndpi_quick_hash((unsigned char *)&packet->iphv6->ip6_dst, sizeof(packet->iphv6->ip6_dst)); - ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, h, 1 /* dummy */); + ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, h, 1 /* dummy */, ndpi_get_current_time(flow)); } } |