torrent-discovery
Advanced tools
Comparing version 3.0.3 to 3.1.0
24
index.js
@@ -8,2 +8,3 @@ module.exports = Discovery | ||
var inherits = require('inherits') | ||
var parallel = require('run-parallel') | ||
var reemit = require('re-emitter') | ||
@@ -77,9 +78,18 @@ var Tracker = require('bittorrent-tracker/client') | ||
var self = this | ||
if (self.tracker) { | ||
if (self.tracker.stop) self.tracker.stop() | ||
if (self.tracker.destroy) self.tracker.destroy() | ||
var tasks = [] | ||
if (self.tracker && self.tracker !== true) { | ||
self.tracker.stop() | ||
tasks.push(function (cb) { | ||
self.tracker.destroy(cb) | ||
}) | ||
} | ||
if (!self._externalDHT && self.dht && self.dht.destroy) self.dht.destroy(cb) | ||
else process.nextTick(function () { cb(null) }) | ||
if (!self._externalDHT && self.dht && self.dht !== true) { | ||
tasks.push(function (cb) { | ||
self.dht.destroy(cb) | ||
}) | ||
} | ||
parallel(tasks, cb) | ||
} | ||
@@ -112,4 +122,6 @@ | ||
self.tracker = new Tracker(self.peerId, self.port, torrent, trackerOpts) | ||
reemit(self.tracker, self, ['peer', 'warning', 'error']) | ||
self.tracker.on('update', function (data) { | ||
self.emit('trackerAnnounce', data) | ||
}) | ||
self.tracker.start() | ||
@@ -116,0 +128,0 @@ } |
{ | ||
"name": "torrent-discovery", | ||
"description": "Discover BitTorrent and WebTorrent peers", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"author": { | ||
@@ -22,2 +22,3 @@ "name": "Feross Aboukhadijeh", | ||
"re-emitter": "^1.0.0", | ||
"run-parallel": "^1.1.2", | ||
"xtend": "^4.0.0" | ||
@@ -24,0 +25,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11205
184
7
+ Addedrun-parallel@^1.1.2