从对端下载扩展握手响应失败,由 bep10

Download the extended handshake response from peers failed by 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
}

我得到了握手和扩展位域并且有 Piece ok,但是没有扩展数据消息。

wireshark dump data

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

你在 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