aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-12-21 23:04:27 +0100
committerLuca Deri <deri@ntop.org>2021-12-21 23:04:27 +0100
commit4c02c81bf4698ac3350ee8b77eff5e72a0780f06 (patch)
tree0c907195f0a6cb2dbdbbbd82455be344f40817a3 /src/lib/ndpi_main.c
parenta16b4aa564fe407e977614011908ca34b7754f4f (diff)
Improved bittorrent heuristic
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 3ea20f436..ad70e59c6 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -4928,8 +4928,10 @@ int ndpi_search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_
/* Check cached communications */
key1 = ndpi_bittorrent_hash_funct(saddr, sport), key2 = ndpi_bittorrent_hash_funct(daddr, dport);
- found = ndpi_lru_find_cache(ndpi_struct->bittorrent_cache, key1, &cached_proto, 0 /* Don't remove it as it can be used for other connections */)
- || ndpi_lru_find_cache(ndpi_struct->bittorrent_cache, key2, &cached_proto, 0 /* Don't remove it as it can be used for other connections */);
+ found =
+ ndpi_lru_find_cache(ndpi_struct->bittorrent_cache, saddr+daddr, &cached_proto, 0 /* Don't remove it as it can be used for other connections */)
+ || ndpi_lru_find_cache(ndpi_struct->bittorrent_cache, key1, &cached_proto, 0 /* Don't remove it as it can be used for other connections */)
+ || ndpi_lru_find_cache(ndpi_struct->bittorrent_cache, key2, &cached_proto, 0 /* Don't remove it as it can be used for other connections */);
#ifdef BITTORRENT_CACHE_DEBUG
if(packet->udp)