mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.94k stars 227 forks source link

Error: not part of int at:6 #148

Open NathanHazout opened 8 years ago

NathanHazout commented 8 years ago

Very often, in the middle of a torrent download, I get:

/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:222
            throw new Error('not part of int at:'+pos.toString(16))
                  ^
Error: not part of int at:6
    at BdecodeSMachine.parse (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:222:19)
    at Bdecode.decode (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:322:14)
    at Object.decode (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:444:11)
    at null.<anonymous> (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/torrent-stream/lib/exchange-metadata.js:22:23)
    at g (events.js:199:16)
    at emit (events.js:110:17)
    at Wire._onextended (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:306:7)
    at onmessage (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:112:16)
    at Wire._write (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:355:8)
    at doWrite (_stream_writable.js:301:12)
    at writeOrBuffer (_stream_writable.js:288:5)
mafintosh commented 8 years ago

hmm weird. we should try catch the bencoding it seems.