aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/bittorrent.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
committerLuca Deri <deri@ntop.org>2018-05-14 21:40:27 +0200
commit1076455c01bfcfa51b24ff8d681e65fd00047dbd (patch)
tree1ffe59c0ae57a55499cece7a2131431bdcf6eea2 /src/lib/protocols/bittorrent.c
parent2d486aeed8e6450cc8034d6244848297bdefc31e (diff)
Added ndpi_set_detection_preferences() APi call
Diffstat (limited to 'src/lib/protocols/bittorrent.c')
-rw-r--r--src/lib/protocols/bittorrent.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c
index 81fc3baf6..fceafc188 100644
--- a/src/lib/protocols/bittorrent.c
+++ b/src/lib/protocols/bittorrent.c
@@ -57,7 +57,8 @@ static u_int8_t is_utp_pkt(const u_int8_t *payload, u_int payload_len) {
return(1);
}
-static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
+static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
int bt_offset, int check_hash,
const u_int8_t save_detection, const u_int8_t encrypted_connection)
{
@@ -73,7 +74,9 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
} else
bt_hash = (const char*)&flow->packet.payload[28];
- if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
+ if(!ndpi_struct->disable_metadata_export) {
+ if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
+ }
}
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);