Merge pull request #185 from sidd/master

Fix issue where seeders improperly marked as leechers
This commit is contained in:
Feross Aboukhadijeh 2016-12-04 17:07:38 -08:00 committed by GitHub
commit a32ae8f1b4

View File

@ -24,7 +24,9 @@ function parseHttpRequest (req, opts) {
params.port = Number(params.port) params.port = Number(params.port)
if (!params.port) throw new Error('invalid port') if (!params.port) throw new Error('invalid port')
params.left = Number(params.left) || Infinity params.left = Number(params.left)
if (isNaN(params.left)) params.left = Infinity
params.compact = Number(params.compact) || 0 params.compact = Number(params.compact) || 0
params.numwant = Math.min( params.numwant = Math.min(
Number(params.numwant) || common.DEFAULT_ANNOUNCE_PEERS, Number(params.numwant) || common.DEFAULT_ANNOUNCE_PEERS,