From b4043d3e7400cc521b48b9729aaea74078553c37 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 10 Mar 2016 18:44:04 -0800 Subject: [PATCH 1/5] npmignore img --- .npmignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..2e1712c --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +img.png From 7406750b747de119ce9025855f945cb6ff998344 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 10 Mar 2016 18:44:51 -0800 Subject: [PATCH 2/5] 7.3.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7238769..410f4eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "7.3.2", + "version": "7.3.3", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From e185f321d39ca99cb34797967403e86f70709323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez=20Baquero?= Date: Fri, 11 Mar 2016 01:10:34 -0300 Subject: [PATCH 3/5] Delete peer on announce stopped --- lib/server/swarm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server/swarm.js b/lib/server/swarm.js index 8d2765c..cc865f1 100644 --- a/lib/server/swarm.js +++ b/lib/server/swarm.js @@ -66,7 +66,7 @@ Swarm.prototype._onAnnounceStopped = function (params, peer) { if (peer.complete) this.complete -= 1 else this.incomplete -= 1 - this.peers[params.addr || params.peer_id] = null + delete this.peers[params.addr || params.peer_id] } Swarm.prototype._onAnnounceCompleted = function (params, peer) { From 0585d8b18ac4dfde55c280ff5aa4863de4483c90 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 10 Mar 2016 21:26:28 -0800 Subject: [PATCH 4/5] use `delete obj[key]` instead of `obj[key] = null` --- lib/client/websocket-tracker.js | 6 +++--- lib/server/swarm.js | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index 280ca8f..773aa83 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -70,7 +70,7 @@ WebSocketTracker.prototype.destroy = function (onclose) { self.destroyed = true clearInterval(self.interval) - socketPool[self.announceUrl] = null + delete socketPool[self.announceUrl] self.socket.removeListener('connect', self._onSocketConnectBound) self.socket.removeListener('data', self._onSocketDataBound) @@ -208,7 +208,7 @@ WebSocketTracker.prototype._onSocketData = function (data) { clearTimeout(peer.trackerTimeout) peer.trackerTimeout = null - self.peers[offerId] = null + delete self.peers[offerId] } else { debug('got unexpected answer: ' + JSON.stringify(data.answer)) } @@ -281,7 +281,7 @@ WebSocketTracker.prototype._generateOffers = function (numwant, cb) { peer.trackerTimeout = setTimeout(function () { debug('tracker timeout: destroying peer') peer.trackerTimeout = null - self.peers[offerId] = null + delete self.peers[offerId] peer.destroy() }, OFFER_TIMEOUT) } diff --git a/lib/server/swarm.js b/lib/server/swarm.js index cc865f1..212fa1e 100644 --- a/lib/server/swarm.js +++ b/lib/server/swarm.js @@ -103,7 +103,6 @@ Swarm.prototype._getPeers = function (numwant, ownPeerId, isWebRTC) { var peerId while ((peerId = ite()) && peers.length < numwant) { var peer = this.peers[peerId] - if (!peer) continue if (isWebRTC && peer.peerId === ownPeerId) continue // don't send peer to itself if ((isWebRTC && peer.ip) || (!isWebRTC && peer.socket)) continue // send proper peer type peers.push(peer) From 18de34050b2352e58408f079fdc79dc807462479 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 10 Mar 2016 21:27:38 -0800 Subject: [PATCH 5/5] 7.3.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 410f4eb..db56cc9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "7.3.3", + "version": "7.3.4", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org",