Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webtorrent/bittorrent-tracker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.8.1
Choose a base ref
...
head repository: webtorrent/bittorrent-tracker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.9.0
Choose a head ref
  • 4 commits
  • 2 files changed
  • 2 contributors

Commits on Apr 23, 2018

  1. Fix filter function

    qqdaiyu55 committed Apr 23, 2018
    Copy the full SHA
    5ad210b View commit details

Commits on Apr 24, 2018

  1. standard

    qqdaiyu55 committed Apr 24, 2018
    Copy the full SHA
    2ba6946 View commit details

Commits on Apr 30, 2018

  1. Merge pull request #272 from qqdaiyu55/master

    Fix filter function
    feross authored Apr 30, 2018
    Copy the full SHA
    c98c40a View commit details

Commits on May 1, 2018

  1. 9.9.0

    feross committed May 1, 2018
    Copy the full SHA
    e758fba View commit details
Showing with 15 additions and 20 deletions.
  1. +1 −1 package.json
  2. +14 −19 server.js
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bittorrent-tracker",
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
"version": "9.8.1",
"version": "9.9.0",
"author": {
"name": "WebTorrent, LLC",
"email": "feross@webtorrent.io",
33 changes: 14 additions & 19 deletions server.js
Original file line number Diff line number Diff line change
@@ -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)
} 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)
})
// Precense of err means that this torrent or user is disallowd
if (err) cb(err)
else {
if (swarm) announce(swarm)
else createSwarm()
}
})
} else {
self.createSwarm(params.info_hash, function (err, swarm) {
if (err) return cb(err)
announce(swarm)
})
if (swarm) announce(swarm)
else createSwarm()
}
})

function createSwarm () {
self.createSwarm(params.info_hash, function (err, swarm) {
if (err) return cb(err)
announce(swarm)
})
}

function announce (swarm) {