mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +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)
|
||||
|
||||
clearTimeout(peer.trackerTimeout)
|
||||
peer.trackerTimeout = null
|
||||
self.peers[offerId] = null
|
||||
} else {
|
||||
debug('got unexpected answer: ' + JSON.stringify(data.answer))
|
||||
@ -279,8 +280,10 @@ WebSocketTracker.prototype._generateOffers = function (numwant, cb) {
|
||||
checkDone()
|
||||
})
|
||||
peer.trackerTimeout = setTimeout(function () {
|
||||
peer.destroy()
|
||||
debug('tracker timeout: destroying peer')
|
||||
peer.trackerTimeout = null
|
||||
self.peers[offerId] = null
|
||||
peer.destroy()
|
||||
}, OFFER_TIMEOUT)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user