bittorrent: fix variable ‘peer_id’ set but not used [-Werror=unused-but-set-variable]

This commit is contained in:
Alexis La Goutte
2016-11-13 18:22:03 +01:00
parent 612a07f420
commit 45bcb9927d
+2 -3
View File
@@ -57,16 +57,15 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
{
if(check_hash) {
const char *bt_hash = NULL; /* 20 bytes long */
const char *peer_id = NULL; /* 20 bytes long */
if(bt_offset == -1) {
const char *bt_magic = ndpi_strnstr((const char *)flow->packet.payload,
"BitTorrent protocol", flow->packet.payload_packet_len);
if(bt_magic)
bt_hash = &bt_magic[19], peer_id = &bt_magic[39];
bt_hash = &bt_magic[19];
} else
bt_hash = (const char*)&flow->packet.payload[28], peer_id = (const char*)&flow->packet.payload[48];
bt_hash = (const char*)&flow->packet.payload[28];
if(bt_hash) memcpy(flow->bittorent_hash, bt_hash, 20);
}