One more fix for IPv6 UDP support

For #73
This commit is contained in:
Feross Aboukhadijeh 2015-05-03 14:20:17 -07:00
parent d56dd26950
commit 4c3c950056

View File

@ -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
/** /**