mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +00:00
parent
d56dd26950
commit
4c3c950056
@ -7,8 +7,6 @@ var common = require('./common')
|
|||||||
function parseUdpRequest (msg, rinfo) {
|
function parseUdpRequest (msg, rinfo) {
|
||||||
if (msg.length < 16) throw new Error('received packet is too short')
|
if (msg.length < 16) throw new Error('received packet is too short')
|
||||||
|
|
||||||
if (rinfo.family !== 'IPv4') throw new Error('udp tracker does not support IPv6')
|
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
connectionId: msg.slice(0, 8), // 64-bit
|
connectionId: msg.slice(0, 8), // 64-bit
|
||||||
action: msg.readUInt32BE(8),
|
action: msg.readUInt32BE(8),
|
||||||
@ -63,8 +61,6 @@ function parseUdpRequest (msg, rinfo) {
|
|||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|
||||||
// HELPER FUNCTIONS
|
|
||||||
|
|
||||||
var TWO_PWR_32 = (1 << 16) * 2
|
var TWO_PWR_32 = (1 << 16) * 2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user