mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-05-22 16:29:29 +00:00
client _handleResponse: allow string form of peer.ip
This commit is contained in:
parent
7376843920
commit
4f1ea32f35
@ -497,8 +497,10 @@ Tracker.prototype._handleResponse = function (requestUrl, data) {
|
|||||||
// tracker returned normal response
|
// tracker returned normal response
|
||||||
data.peers.forEach(function (peer) {
|
data.peers.forEach(function (peer) {
|
||||||
var ip = peer.ip
|
var ip = peer.ip
|
||||||
var addr = ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3] + ':' + peer.port
|
var host = ip.length == 4 ?
|
||||||
self.client.emit('peer', addr)
|
(ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]) :
|
||||||
|
ip.toString()
|
||||||
|
self.client.emit('peer', host + ':' + peer.port)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if (requestUrl === self._scrapeUrl) {
|
} else if (requestUrl === self._scrapeUrl) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user