mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-02-07 13:59:07 +00:00
Merge remote-tracking branch 'upstream/master' into client-infos
This commit is contained in:
commit
af631d9fce
1
.npmignore
Normal file
1
.npmignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
img.png
|
@ -70,7 +70,7 @@ WebSocketTracker.prototype.destroy = function (onclose) {
|
|||||||
self.destroyed = true
|
self.destroyed = true
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
|
||||||
socketPool[self.announceUrl] = null
|
delete socketPool[self.announceUrl]
|
||||||
|
|
||||||
self.socket.removeListener('connect', self._onSocketConnectBound)
|
self.socket.removeListener('connect', self._onSocketConnectBound)
|
||||||
self.socket.removeListener('data', self._onSocketDataBound)
|
self.socket.removeListener('data', self._onSocketDataBound)
|
||||||
@ -208,7 +208,7 @@ WebSocketTracker.prototype._onSocketData = function (data) {
|
|||||||
|
|
||||||
clearTimeout(peer.trackerTimeout)
|
clearTimeout(peer.trackerTimeout)
|
||||||
peer.trackerTimeout = null
|
peer.trackerTimeout = null
|
||||||
self.peers[offerId] = null
|
delete self.peers[offerId]
|
||||||
} else {
|
} else {
|
||||||
debug('got unexpected answer: ' + JSON.stringify(data.answer))
|
debug('got unexpected answer: ' + JSON.stringify(data.answer))
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ WebSocketTracker.prototype._generateOffers = function (numwant, cb) {
|
|||||||
peer.trackerTimeout = setTimeout(function () {
|
peer.trackerTimeout = setTimeout(function () {
|
||||||
debug('tracker timeout: destroying peer')
|
debug('tracker timeout: destroying peer')
|
||||||
peer.trackerTimeout = null
|
peer.trackerTimeout = null
|
||||||
self.peers[offerId] = null
|
delete self.peers[offerId]
|
||||||
peer.destroy()
|
peer.destroy()
|
||||||
}, OFFER_TIMEOUT)
|
}, OFFER_TIMEOUT)
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ Swarm.prototype._onAnnounceStopped = function (params, peer) {
|
|||||||
if (peer.complete) this.complete -= 1
|
if (peer.complete) this.complete -= 1
|
||||||
else this.incomplete -= 1
|
else this.incomplete -= 1
|
||||||
var id = params.type === common.PEER_TYPES.websocket ? params.peer_id : params.addr
|
var id = params.type === common.PEER_TYPES.websocket ? params.peer_id : params.addr
|
||||||
this.peers[id] = null
|
delete this.peers[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
Swarm.prototype._onAnnounceCompleted = function (params, peer) {
|
Swarm.prototype._onAnnounceCompleted = function (params, peer) {
|
||||||
@ -107,7 +107,6 @@ Swarm.prototype._getPeers = function (numwant, ownPeerId, isWebRTC) {
|
|||||||
var peerId
|
var peerId
|
||||||
while ((peerId = ite()) && peers.length < numwant) {
|
while ((peerId = ite()) && peers.length < numwant) {
|
||||||
var peer = this.peers[peerId]
|
var peer = this.peers[peerId]
|
||||||
if (!peer) continue
|
|
||||||
if (isWebRTC && peer.peerId === ownPeerId) continue // don't send peer to itself
|
if (isWebRTC && peer.peerId === ownPeerId) continue // don't send peer to itself
|
||||||
if ((isWebRTC && peer.ip) || (!isWebRTC && peer.socket)) continue // send proper peer type
|
if ((isWebRTC && peer.ip) || (!isWebRTC && peer.socket)) continue // send proper peer type
|
||||||
peers.push(peer)
|
peers.push(peer)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "bittorrent-tracker",
|
"name": "bittorrent-tracker",
|
||||||
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
|
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
|
||||||
"version": "7.3.2",
|
"version": "7.3.4",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Feross Aboukhadijeh",
|
"name": "Feross Aboukhadijeh",
|
||||||
"email": "feross@feross.org",
|
"email": "feross@feross.org",
|
||||||
|
Loading…
Reference in New Issue
Block a user