mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 11:26:25 +00:00
more cleanup
This commit is contained in:
parent
3f1c9644ec
commit
8d735bf97d
@ -208,6 +208,7 @@ WebSocketTracker.prototype._onSocketData = function (data) {
|
|||||||
self.client.emit('peer', peer)
|
self.client.emit('peer', peer)
|
||||||
|
|
||||||
clearTimeout(peer.trackerTimeout)
|
clearTimeout(peer.trackerTimeout)
|
||||||
|
peer.trackerTimeout = null
|
||||||
self.peers[offerId] = null
|
self.peers[offerId] = null
|
||||||
} else {
|
} else {
|
||||||
debug('got unexpected answer: ' + JSON.stringify(data.answer))
|
debug('got unexpected answer: ' + JSON.stringify(data.answer))
|
||||||
@ -279,8 +280,10 @@ WebSocketTracker.prototype._generateOffers = function (numwant, cb) {
|
|||||||
checkDone()
|
checkDone()
|
||||||
})
|
})
|
||||||
peer.trackerTimeout = setTimeout(function () {
|
peer.trackerTimeout = setTimeout(function () {
|
||||||
peer.destroy()
|
debug('tracker timeout: destroying peer')
|
||||||
|
peer.trackerTimeout = null
|
||||||
self.peers[offerId] = null
|
self.peers[offerId] = null
|
||||||
|
peer.destroy()
|
||||||
}, OFFER_TIMEOUT)
|
}, OFFER_TIMEOUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user