mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-05 22:10:11 +00:00
Revert "prevent "value out of bounds error""
This reverts commit 25b25f663c
.
This commit is contained in:
parent
1338282cc9
commit
68f2317870
@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
var querystring = require('querystring')
|
var querystring = require('querystring')
|
||||||
|
|
||||||
var MAX_UINT = Math.pow(2, 32) - 1
|
|
||||||
|
|
||||||
exports.IPV4_RE = /^[\d\.]+$/
|
exports.IPV4_RE = /^[\d\.]+$/
|
||||||
exports.IPV6_RE = /^[\da-fA-F:]+$/
|
exports.IPV6_RE = /^[\da-fA-F:]+$/
|
||||||
|
|
||||||
@ -27,7 +25,6 @@ exports.EVENT_NAMES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toUInt32 (n) {
|
function toUInt32 (n) {
|
||||||
if (n > MAX_UINT) n = MAX_UINT
|
|
||||||
var buf = new Buffer(4)
|
var buf = new Buffer(4)
|
||||||
buf.writeUInt32BE(n, 0)
|
buf.writeUInt32BE(n, 0)
|
||||||
return buf
|
return buf
|
||||||
|
Loading…
Reference in New Issue
Block a user