actually iterate over ipv6 peers

This commit is contained in:
Feross Aboukhadijeh 2014-11-27 17:31:33 +08:00
parent 0c709523df
commit 0b831d2fde

View File

@ -512,10 +512,10 @@ Tracker.prototype._handleResponse = function (requestUrl, data) {
})
} else if (Array.isArray(data.peers6)) {
// tracker returned normal response
data.peers.forEach(function (peer) {
var ip = /^\[/.test(peer.ip)
? peer.ip
: '[' + peer.ip + ']'
data.peers6.forEach(function (peer) {
self.client.emit('peer', ip + ':' + peer.port)
})
}