kzahel / jstorrent

JavaScript Torrent Client primarily for ChromeOS and the Chrome Web Store
https://www.jstorrent.com
Other
407 stars 114 forks source link

Bandaid @ peerconnection.js line 761, range error, not enough bytes in msg #167

Open ghost opened 6 years ago

ghost commented 6 years ago

The error didn't say that exactly, but it appears that a parameter's (msg) .payload wasn't long enough bytewise to invoke 'var v = new DataView(msg.payload, 5, 12)', which gets a view of the data from byte 5 to byte 12.

From the comment it looks like you're already aware of the problem. I honestly haven't looked at what I was doing long enough to see if I'm setting a time bomb on myself, but it appears to work fine, so I'll fly with my little bandaid as long as it appears to work.

EDIT: I had a code snipped where I wrapped the inside of the function in an if statement, but I'm pretty sure it didn't help at all. It may have stopped the error messages for a moment, but I think I was just able to remove the offending torrent and that solved my problem.