mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 10:56:25 +00:00
small cleanup
This commit is contained in:
parent
3abb687b89
commit
37f95b4b54
@ -35,7 +35,7 @@ function parseUdpRequest (msg, rinfo) {
|
||||
? ipLib.toString(ip)
|
||||
: rinfo.address
|
||||
|
||||
params.key = msg.readUInt32BE(88) // TODO: what is this for?
|
||||
params.key = msg.readUInt32BE(88) // Optional: unique random key from client
|
||||
|
||||
// never send more than MAX_ANNOUNCE_PEERS or else the UDP packet will get bigger than
|
||||
// 512 bytes which is not safe
|
||||
|
@ -49,11 +49,13 @@ function serverTest (t, serverType, serverFamily) {
|
||||
t.equal(data.complete, 0)
|
||||
t.equal(data.incomplete, 1)
|
||||
|
||||
var swarm = server.getSwarm(infoHash)
|
||||
|
||||
t.equal(Object.keys(server.torrents).length, 1)
|
||||
t.equal(server.getSwarm(infoHash).complete, 0)
|
||||
t.equal(server.getSwarm(infoHash).incomplete, 1)
|
||||
t.equal(Object.keys(server.getSwarm(infoHash).peers).length, 1)
|
||||
t.deepEqual(server.getSwarm(infoHash).peers[clientAddr + ':6881'], {
|
||||
t.equal(swarm.complete, 0)
|
||||
t.equal(swarm.incomplete, 1)
|
||||
t.equal(Object.keys(swarm.peers).length, 1)
|
||||
t.deepEqual(swarm.peers[clientAddr + ':6881'], {
|
||||
ip: clientIp,
|
||||
port: 6881,
|
||||
peerId: peerId.toString('hex'),
|
||||
|
Loading…
Reference in New Issue
Block a user