bangalore-haskell-user-group / functorrent

A bit torrent client
GNU General Public License v3.0
18 stars 9 forks source link

Bencode.decode should parse the input string recursively #11

Closed jaseemabid closed 9 years ago

jaseemabid commented 9 years ago

Bencode.decode returns a illegible bytestring for peers, rather than a peers list. This makes the top level Bdict pretty hard to read and test. There is nothing preventing this as far as I understand. We do a 2 pass decode on the structure with getPeerResponse, which can be avoided.

See the screenshot for a failed test.

screen shot 2015-03-21 at 9 58 32 pm

jaseemabid commented 9 years ago

The same holds for peers now. See https://github.com/vu3rdd/functorrent/commit/4ca067b3afdf67592f131964cff799d2930395a5

jaseemabid commented 9 years ago

Fixed here https://github.com/vu3rdd/functorrent/commit/ac4100f4f9ed09fcba4c482f3c245fc5837324b1