bittorrent-dht
Advanced tools
Comparing version 7.8.1 to 7.8.2
@@ -549,3 +549,3 @@ module.exports = DHT | ||
var port = query.a.implied_port ? peer.port : query.a.port | ||
if (!port || typeof port !== 'number') return | ||
if (!port || typeof port !== 'number' || port <= 0 || port > 65535) return | ||
var infoHash = query.a.info_hash | ||
@@ -552,0 +552,0 @@ var token = query.a.token |
{ | ||
"name": "bittorrent-dht", | ||
"description": "Simple, robust, BitTorrent DHT implementation", | ||
"version": "7.8.1", | ||
"version": "7.8.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "WebTorrent, LLC", |
@@ -195,2 +195,18 @@ var Buffer = require('safe-buffer').Buffer | ||
test('`announce_peer` with bad port', function (t) { | ||
t.plan(1) | ||
var dht1 = new DHT({ bootstrap: false }) | ||
dht1.listen(function () { | ||
var dht2 = new DHT({ bootstrap: '127.0.0.1:' + dht1.address().port, timeout: 100 }) | ||
var infoHash = common.randomId() | ||
dht2.announce(infoHash, 99999, function (err) { | ||
dht1.destroy() | ||
dht2.destroy() | ||
t.ok(err, 'had error') | ||
}) | ||
}) | ||
}) | ||
test('`announce_peer` query gets ack response', function (t) { | ||
@@ -197,0 +213,0 @@ t.plan(5) |
92312
2432