mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 02:46:29 +00:00
commit
c98c40abe5
37
server.js
37
server.js
@ -659,32 +659,27 @@ Server.prototype._onAnnounce = function (params, cb) {
|
||||
|
||||
self.getSwarm(params.info_hash, function (err, swarm) {
|
||||
if (err) return cb(err)
|
||||
if (swarm) {
|
||||
announce(swarm)
|
||||
|
||||
if (self._filter) {
|
||||
self._filter(params.info_hash, params, function (err) {
|
||||
// Precense of err means that this torrent or user is disallowd
|
||||
if (err) cb(err)
|
||||
else {
|
||||
if (swarm) announce(swarm)
|
||||
else createSwarm()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
createSwarm()
|
||||
if (swarm) announce(swarm)
|
||||
else createSwarm()
|
||||
}
|
||||
})
|
||||
|
||||
function createSwarm () {
|
||||
if (self._filter) {
|
||||
self._filter(params.info_hash, params, function (err) {
|
||||
// Precense of err means that this info_hash is disallowed
|
||||
if (err) {
|
||||
cb(err)
|
||||
} else {
|
||||
self.createSwarm(params.info_hash, function (err, swarm) {
|
||||
if (err) return cb(err)
|
||||
announce(swarm)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
self.createSwarm(params.info_hash, function (err, swarm) {
|
||||
if (err) return cb(err)
|
||||
announce(swarm)
|
||||
})
|
||||
}
|
||||
self.createSwarm(params.info_hash, function (err, swarm) {
|
||||
if (err) return cb(err)
|
||||
announce(swarm)
|
||||
})
|
||||
}
|
||||
|
||||
function announce (swarm) {
|
||||
|
Loading…
Reference in New Issue
Block a user