Reputation: 7088
BEP9(ut_metadata) data message has a total_size
field and I'm having trouble seeing what it means.
The message is in this format:
<4-byte length prefix><20><1-byte extended msg id><bencode part><piece data>
I'm confused about two things:
<piece data>
part?total_size
field in bencode_part
specify?It looks to me like we don't need total_size
, unless I'm misunderstanding something.
Here is currently how I'm parsing it:
<piece data>
so I know exactly how big this message is. I'm reading that many bytes.<bencode_part>
, I'm just consuming rest of the bytes and consider this the data.Can anyone help me understanding this format?
Thanks.
Upvotes: 0
Views: 348
Reputation: 43125
Upvotes: 1