mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-02-07 13:59:07 +00:00
i'm getting tired
This commit is contained in:
parent
2cf4bf649d
commit
c38cdd94e1
6
index.js
6
index.js
@ -352,8 +352,8 @@ Server.prototype._onRequest = function (req, res) {
|
|||||||
var port = Number(params.port)
|
var port = Number(params.port)
|
||||||
var addr = ip + ':' + port
|
var addr = ip + ':' + port
|
||||||
|
|
||||||
var infoHash = bytewiseDecodeURIComponent(params.info_hash)
|
var infoHash = bytewiseDecodeURIComponent(params.info_hash).toString('hex')
|
||||||
var peerId = bytewiseDecodeURIComponent(params.peer_id)
|
var peerId = bytewiseDecodeURIComponent(params.peer_id).toString('utf8')
|
||||||
|
|
||||||
var swarm = self.torrents[infoHash]
|
var swarm = self.torrents[infoHash]
|
||||||
if (!swarm) {
|
if (!swarm) {
|
||||||
@ -494,5 +494,5 @@ function bytewiseEncodeURIComponent (buf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function bytewiseDecodeURIComponent (str) {
|
function bytewiseDecodeURIComponent (str) {
|
||||||
return (new Buffer(decodeURIComponent(str), 'binary').toString('hex'))
|
return new Buffer(decodeURIComponent(str), 'binary')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user