bittorrent - 下载来自对等方的扩展握手响应,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,但没有扩展数据消息。
需要帮助解决这个问题,谢谢!
解决方案
来自 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
推荐阅读
- nomad - Hashicorp Nomad 在启动后杀死了 zookeeper 进程
- amazon-s3 - 使用 s3cmd 排除同步到 AmazonS3 的子文件夹
- swift - RxSwift 使用 RxCocoa 绑定到动画
- firebase - 将 Firebase 崩溃报告更新到 Firebase Crashlytics:仍在旧仪表板上
- python - Airflow/Composer - 在 zip 打包的 DAG 中找不到模板
- php - MySQL 错误“未选择数据库”是什么意思?
- php - SagePay API - 创建交易时请求格式不正确 - Php
- mysql - 如何通过控制台禁用对数据库导入的外键检查?
- android - Android:如何在 RecyclerView 中为每张卡片设置不同的高度?
- string - 检查 Map 中的值是否是 String 的一部分