首页 > 解决方案 > 下载来自对等方的扩展握手响应,bep10 失败

问题描述

在从同行下载元数据之前,我必须获取扩展消息数据,如下所示:

{
e: 0,
ipv4: xxx,
ipv6: xxx,
complete_ago: 1,
m:
{
    upload_only: 3,
    lt_donthave: 7,
    ut_holepunch: 4,
    ut_metadata: 2,
    ut_pex: 1,
    ut_comment: 6
},
matadata_size: 45377,
p: 33733,
reqq: 255,
v: BitTorrent 7.9.3
yp: 19616,
yourip: xxx
}

我得到了 Handshake 和 Extended Bitfield 和 Have Piece ok,但没有扩展数据消息。

线鲨

Wireshark 转储数据

需要帮助解决这个问题,谢谢!

标签: bittorrentdhttorrent

解决方案


来自 pcap 的一次握手:

BitTorrent Protocol Name Length: 19 Protocol Name: BitTorrent protocol Reserved Extension Bytes: 0000000000000000 SHA1 Hash of info dictionary: 7dd228be16c64d996be7a1bd7355cc416284d6dc Peer ID: 0401832c018f1ef9f25632c1b3d65d593113edc6 0000 13 42 69 74 54 6f 72 72 65 6e 74 20 70 72 6f 74 .BitTorrent prot 0010 6f 63 6f 6c 00 00 00 00 00 00 00 00 7d d2 28 be ocol........}.(. 0020 16 c6 4d 99 6b e7 a1 bd 73 55 cc 41 62 84 d6 dc ..M.k...sU.Ab... 0030 04 01 83 2c 01 8f 1e f9 f2 56 32 c1 b3 d6 5d 59 ...,.....V2...]Y 0040 31 13 ed c6 1...

问题是扩展握手的位未在保留的扩展字节中设置。这将导致其他对等方在收到意外的扩展握手时将关闭连接。

它应该是:

Reserved Extension Bytes: 0000000000100000


推荐阅读