mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 19:36: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 bufferEqual = require('buffer-equal')
|
||||||
|
var ipLib = require('ip')
|
||||||
var common = require('./common')
|
var common = require('./common')
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ function parseUdpRequest (msg, rinfo) {
|
|||||||
params.ip = msg.readUInt32BE(84) // optional
|
params.ip = msg.readUInt32BE(84) // optional
|
||||||
params.ip = params.ip ?
|
params.ip = params.ip ?
|
||||||
ipLib.toString(params.ip) :
|
ipLib.toString(params.ip) :
|
||||||
params.ip = rinfo.address
|
rinfo.address
|
||||||
params.key = msg.readUInt32BE(88) // TODO: what is this for?
|
params.key = msg.readUInt32BE(88) // TODO: what is this for?
|
||||||
params.numwant = msg.readUInt32BE(92) // optional
|
params.numwant = msg.readUInt32BE(92) // optional
|
||||||
// never send more than MAX_ANNOUNCE_PEERS or else the UDP packet will get bigger than
|
// 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 EventEmitter = require('events').EventEmitter
|
||||||
var http = require('http')
|
var http = require('http')
|
||||||
var inherits = require('inherits')
|
var inherits = require('inherits')
|
||||||
var ipLib = require('ip')
|
|
||||||
var portfinder = require('portfinder')
|
var portfinder = require('portfinder')
|
||||||
var series = require('run-series')
|
var series = require('run-series')
|
||||||
var string2compact = require('string2compact')
|
var string2compact = require('string2compact')
|
||||||
|
Loading…
Reference in New Issue
Block a user