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

Josef Drexler josef at ttdpatch.net
Wed Jan 20 15:05:30 EST 2010

On Jan 20, 2010, at 8:49 PM, Alan McGovern wrote:
> However, my library currently does option 3 and I've been highly  
> against changing that to support option 1 for a long time now ;)  
> Having some clients support option 1 and others support option 2 is  
> the problem I'm trying to tackle here. Ideally (in my eyes) we  
> should all use option 3, otherwise we need to settle on 1 or 2.  
> Input from both uTorrent and Azureus would be great as they are the  
> two biggest players, so if anyone knows uTorrent/Azureus devs,  
> please try to get them to chime in.

libTorrent/rTorrent used to do option 1 (generate valid bencode from  
a slightly broken .torrent file), but I changed it so that it now  
refuses to recognize the .torrent file. From the thread you linked  
and my observations, utorrent does option 2, taking the SHA1 of the  
info substring even if it isn't valid bencode data.

If just refusing the files isn't acceptable, and we need to settle on  
option 1 or 2, I'll definitely be happier with option 1 (and not just  
because in libTorrent the code to do this is already there, but  
dormant). Accepting broken input and processing it as if it was  
valid, instead of fixing it first, is just wrong.

Josef Drexler
josef at ttdpatch.net

More information about the BitTorrent mailing list