From 1076455c01bfcfa51b24ff8d681e65fd00047dbd Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 14 May 2018 21:40:27 +0200 Subject: Added ndpi_set_detection_preferences() APi call --- src/lib/protocols/bittorrent.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/protocols/bittorrent.c') 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); -- cgit v1.2.3