mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
Fix #113
This commit is contained in:
parent
4642467310
commit
f70d0d2f07
@ -337,6 +337,15 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
|
||||
}
|
||||
if (self.destroyed) return
|
||||
|
||||
var hashes
|
||||
if (typeof params.info_hash === 'string') hashes = [ params.info_hash ]
|
||||
else hashes = params.info_hash
|
||||
hashes.forEach(function (info_hash) {
|
||||
if (socket.infoHashes.indexOf(info_hash) === -1) {
|
||||
socket.infoHashes.push(info_hash)
|
||||
}
|
||||
})
|
||||
|
||||
response.action = params.action === common.ACTIONS.ANNOUNCE ? 'announce' : 'scrape'
|
||||
|
||||
var peers
|
||||
|
Loading…
Reference in New Issue
Block a user