[bittorrent] How should .torrent files with unsorted info dictionary keys be handled

Adrian Ulrich torrent at blinkenlights.ch
Thu Jan 21 14:24:20 EST 2010

> If i had to choose between option 1 and 2 I'd go with 1

My vote goes to #1 as it's trivial to implement:

The client has to parse the torrent anyway, so calculating the 'real' sha1 is
as easy as
    metadata  = bdecode('foo.torrent');
    real_sha1 = sha1( bencode( metadata->{info} ) );

But i agree that accepting invalid data is not optimal.

Do we have any statistics about how many torrents are broken?
5%? 50%?

If the breakage is below ~ 10% it would be acceptable for clients
to refused to load invalid torrents.


More information about the BitTorrent mailing list