aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2024-07-29 18:21:45 +0200
committerLuca Deri <deri@ntop.org>2024-07-29 18:21:45 +0200
commitc2b657f0c4a0f000028eaaa897765395296d4c89 (patch)
tree3a00e6562b068fae8a6ff293a140a2781cdacecb /src/lib
parentf3ea8ca6bee3b7a6c7d393c1768f636bdaf7b63d (diff)
Enhanced ookla tracing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/protocols/ookla.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/protocols/ookla.c b/src/lib/protocols/ookla.c
index c7aad161d..dd15636dd 100644
--- a/src/lib/protocols/ookla.c
+++ b/src/lib/protocols/ookla.c
@@ -48,19 +48,21 @@ int ookla_search_into_cache(struct ndpi_detection_module_struct *ndpi_struct,
if(ndpi_struct->ookla_cache) {
key = get_ookla_key(flow);
-#ifdef DEBUG_OOKLA_LRU
- printf("[LRU OOKLA] Search %u\n", key);
-#endif
if(ndpi_lru_find_cache(ndpi_struct->ookla_cache, key,
&dummy, 0 /* Don't remove it as it can be used for other connections */,
ndpi_get_current_time(flow))) {
#ifdef DEBUG_OOKLA_LRU
- printf("[LRU OOKLA] Found\n");
+ printf("[LRU OOKLA] Found %lu [%u <-> %u]\n", key, ntohs(flow->c_port), ntohs(flow->s_port));
#endif
return 1;
- }
+ } else {
+#ifdef DEBUG_OOKLA_LRU
+ printf("[LRU OOKLA] Not found %lu [%u <-> %u]\n", key, ntohs(flow->c_port), ntohs(flow->s_port));
+#endif
+ }
}
+
return 0;
}
@@ -74,7 +76,7 @@ void ookla_add_to_cache(struct ndpi_detection_module_struct *ndpi_struct,
if(ndpi_struct->ookla_cache) {
key = get_ookla_key(flow);
#ifdef DEBUG_OOKLA_LRU
- printf("[LRU OOKLA] ADDING %u\n", key);
+ printf("[LRU OOKLA] ADDING %lu [%u <-> %u]\n", key, ntohs(flow->c_port), ntohs(flow->s_port));
#endif
ndpi_lru_add_to_cache(ndpi_struct->ookla_cache, key, 1 /* dummy */,
ndpi_get_current_time(flow));
@@ -100,6 +102,7 @@ void ndpi_search_ookla(struct ndpi_detection_module_struct* ndpi_struct, struct
flow->ookla_stage = 1;
return;
}
+
if(flow->packet_counter == 2 &&
flow->ookla_stage == 1 &&
packet->payload_packet_len >= NDPI_STATICSTRING_LEN("HELLO") &&