mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-01-05 22:43:08 +00:00
Fix bug where left = 0 would be converted to Infinity
Possibly fixes: https://github.com/feross/bittorrent-tracker/issues/196
This commit is contained in:
parent
27ae148167
commit
c2c8e36af7
@ -28,7 +28,9 @@ function parseWebSocketRequest (socket, opts, params) {
|
|||||||
params.to_peer_id = common.binaryToHex(params.to_peer_id)
|
params.to_peer_id = common.binaryToHex(params.to_peer_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
params.left = Number(params.left) || Infinity
|
params.left = Number(params.left)
|
||||||
|
if (Number.isNaN(params.left)) params.left = Infinity
|
||||||
|
|
||||||
params.numwant = Math.min(
|
params.numwant = Math.min(
|
||||||
Number(params.offers && params.offers.length) || 0, // no default - explicit only
|
Number(params.offers && params.offers.length) || 0, // no default - explicit only
|
||||||
common.MAX_ANNOUNCE_PEERS
|
common.MAX_ANNOUNCE_PEERS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user