From deee4e1d7dba2161dd04c8f8cc71c642ebd35930 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 26 Nov 2014 16:21:45 +0800 Subject: [PATCH] fix client handling to support http `peers` non-compact response --- client.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client.js b/client.js index 9b358d8..4a4dc93 100644 --- a/client.js +++ b/client.js @@ -496,11 +496,7 @@ Tracker.prototype._handleResponse = function (requestUrl, data) { } else if (Array.isArray(data.peers)) { // tracker returned normal response data.peers.forEach(function (peer) { - var ip = peer.ip - var host = ip.length == 4 ? - (ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]) : - ip.toString() - self.client.emit('peer', host + ':' + peer.port) + self.client.emit('peer', peer.ip + ':' + peer.port) }) } } else if (requestUrl === self._scrapeUrl) {