diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-04-11 09:18:04 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-04-11 09:18:04 +0300 |
commit | b4ee1d4706eff6ccf8cf6b8c34f9ea424737a6f2 (patch) | |
tree | 6873f2525e05344a76d5ca9f076a7e851d25ab96 | |
parent | 9cdb94e92feab5784f67f660816034a99cc0ee13 (diff) |
Breaking: rename "blocked-peer" event to "blockedPeer"
-rw-r--r-- | lib/torrent.js | 2 | ||||
-rw-r--r-- | test/blocklist-dht.js | 4 | ||||
-rw-r--r-- | test/blocklist-tracker.js | 4 | ||||
-rw-r--r-- | test/blocklist.js | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 010f19f..6c65383 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -346,7 +346,7 @@ Torrent.prototype.addPeer = function (peer) { && self.client.blocked && self.client.blocked.contains(addrToIPPort(peer)[0])) { self.numBlockedPeers += 1 - self.emit('blocked-peer', peer) + self.emit('blockedPeer', peer) return false } else { self.emit('peer', peer) diff --git a/test/blocklist-dht.js b/test/blocklist-dht.js index 71dee81..9ddb316 100644 --- a/test/blocklist-dht.js +++ b/test/blocklist-dht.js @@ -49,7 +49,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { t.fail('client1 should not find any peers') }) - torrent1.on('blocked-peer', function () { + torrent1.on('blockedPeer', function () { t.fail('client1 should not block any peers') }) }], @@ -64,7 +64,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { var torrent2 = client2.add(leavesParsed) - torrent2.on('blocked-peer', function () { + torrent2.on('blockedPeer', function () { t.pass('client2 blocked connection to client1') }) diff --git a/test/blocklist-tracker.js b/test/blocklist-tracker.js index eefa338..e60d02d 100644 --- a/test/blocklist-tracker.js +++ b/test/blocklist-tracker.js @@ -42,7 +42,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { cb(null, client1) }) - torrent1.on('blocked-peer', function () { + torrent1.on('blockedPeer', function () { t.fail('client1 should not block any peers') }) }], @@ -56,7 +56,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { var torrent2 = client2.add(leavesParsed) - torrent2.on('blocked-peer', function () { + torrent2.on('blockedPeer', function () { t.pass('client2 blocked connection') // 2x, once for each client cb(null, client2) }) diff --git a/test/blocklist.js b/test/blocklist.js index 1d2fe68..b86f828 100644 --- a/test/blocklist.js +++ b/test/blocklist.js @@ -16,7 +16,7 @@ leavesParsed.announce = [] leavesParsed.announceList = [] function assertBlocked (t, torrent, addr) { - torrent.once('blocked-peer', function (_addr) { + torrent.once('blockedPeer', function (_addr) { t.equal(addr, _addr) }) t.notOk(torrent.addPeer(addr)) |