mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 03:16:24 +00:00
parseUdpRequest(): fix params.ip
This commit is contained in:
parent
e234f14d56
commit
7a417a591d
@ -1,4 +1,5 @@
|
||||
var bufferEqual = require('buffer-equal')
|
||||
var ipLib = require('ip')
|
||||
var common = require('./common')
|
||||
|
||||
|
||||
@ -38,7 +39,7 @@ function parseUdpRequest (msg, rinfo) {
|
||||
params.ip = msg.readUInt32BE(84) // optional
|
||||
params.ip = params.ip ?
|
||||
ipLib.toString(params.ip) :
|
||||
params.ip = rinfo.address
|
||||
rinfo.address
|
||||
params.key = msg.readUInt32BE(88) // TODO: what is this for?
|
||||
params.numwant = msg.readUInt32BE(92) // optional
|
||||
// never send more than MAX_ANNOUNCE_PEERS or else the UDP packet will get bigger than
|
||||
|
@ -6,7 +6,6 @@ var dgram = require('dgram')
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
var http = require('http')
|
||||
var inherits = require('inherits')
|
||||
var ipLib = require('ip')
|
||||
var portfinder = require('portfinder')
|
||||
var series = require('run-series')
|
||||
var string2compact = require('string2compact')
|
||||
|
Loading…
Reference in New Issue
Block a user