mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-19 04:31:36 +00:00
Limit number of WebRTC offers to only 5
This commit is contained in:
parent
1de0983864
commit
9a6e854609
@ -6,7 +6,7 @@ var extend = require('xtend/mutable')
|
||||
|
||||
exports.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
||||
|
||||
exports.DEFAULT_ANNOUNCE_PEERS = process.browser ? 5 : 50
|
||||
exports.DEFAULT_ANNOUNCE_PEERS = 50
|
||||
exports.MAX_ANNOUNCE_PEERS = 82
|
||||
|
||||
exports.binaryToHex = function (str) {
|
||||
|
@ -59,6 +59,10 @@ WebSocketTracker.prototype.announce = function (opts) {
|
||||
opts.info_hash = self.client._infoHash.toString('binary')
|
||||
opts.peer_id = self.client._peerId.toString('binary')
|
||||
|
||||
// Limit number of offers to only 5 (temporarily)
|
||||
// TODO: remove this when we cleanup old RTCPeerConnections cleanly
|
||||
if (opts.numWant > 5) opts.numWant = 5
|
||||
|
||||
self._generateOffers(opts.numWant, function (offers) {
|
||||
opts.offers = offers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user