[bittorrent] Bug in BitTorrent 4.20.4.

Alan McGovern alan.mcgovern at gmail.com
Thu Aug 24 08:47:21 EDT 2006


You're right. I hadn't noticed the line saying "Keys must be strings and
appear in sorted order" before (took me a few reads to find it this time, i
was quite close to emailing back and asking you to quote the relevant
passage :p). Still, it would be nice if BitTorrent was able to give a useful
error message. The "error message" it gives is useless to both regular users
and developers, but that's neither here nor there.

Unfortunately i was the one who created the BEncoding section of our engine,
so the blame is all mine ;) Spent ages trying to hunt down the "bug".
Thankfully it's only a  1 line change to fix the problem.


On 8/24/06, Harold Feit <dwknight at depthstrike.com> wrote:
> Hash: SHA1
> Rejecting a torrent that is not created in compliance with BEncoding
> specifications is not a bug.
> BEncoded Dictionary elements must be sorted as per
> http://wiki.theory.org/BitTorrentSpecification#bencoding or else they
> are in violation of the protocol. As such, having dictionary entries of
> 'created by' and 'creation date' in the wrong order is a malformed
> BEncode Dictionary.
> Alan McGovern wrote:
> > Hi,
> >
> > I've tried emailing off the www.bittorrent.com
> > <http://www.bittorrent.com> site, but i got no reply. Basically, the
> > BitTorrent client will choke on parsing perfect .torrent files unless
> > the elements  (creaion date, created by, comment etc) in the .torrent
> > are inserted in a specific order. There is a needless dependance on the
> > order of the BEncoded elements when it comes to decoding a .torrent
> file.
> >
> > To test, just create a .torrent file with the order of the 'created by'
> > and 'creation date' elements reversed, that's enough to cause loading to
> > fail.
> >
> > Thanks,
> > Alan.
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> iQEVAwUBRO2KH18nceBm0DUaAQKtdwf+Iq6PoRt87Kum0FKu0wohp5BndaCTQZeQ
> zmOG0RKgR5D/a3cQBzU5r1N7PhPpVmF9vY2lAaE+tUTIzt1p1ZDEWiGnpluGHRrY
> l5NJ/1PrhNAFHatfIsRcycvp+L2KEyTjnuEQSHwO2MxLjV91u7rVZokABTi7Q6Vv
> 2S+CKzDyKwJgjrDGjAit7WH1gn9gM3jNh4DJKK7LwVXhXXQNRQ7uNd6osteeDFgR
> 3F1B9FgqxM/tFppthU7Z/ksRbRnw+NGC1VMjgK6dUdHwHGDI2urf6QiYEnkbUPSx
> QSysbkUIE79ajTpTKOdRVK1qfZ9ztDjqTrFalgsBoMLRKcnGF23d2g==
> =aTJF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/bittorrent/attachments/20060824/d623303b/attachment.html 

More information about the BitTorrent mailing list