fix parseHost.

This commit is contained in:
Christopher Jeffrey 2016-05-19 01:39:28 -07:00
parent 3979e57acc
commit b83a4a6a2c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 2 additions and 14 deletions

View File

@ -1723,13 +1723,8 @@ Pool.prototype.destroy = function destroy(callback) {
* @returns {Peer?}
*/
Pool.prototype.getPeer = function getPeer(addr) {
if (!addr)
return;
addr = utils.parseHost(addr);
return this.peers.map[addr.host];
Pool.prototype.getPeer = function getPeer(host) {
return this.peers.map[host.host || host];
};
/**

View File

@ -849,13 +849,6 @@ utils.parseHost = function parseHost(addr) {
if (typeof addr === 'object')
return addr;
if (!/[\[:]/.test(addr)) {
return {
host: addr,
port: 0
};
}
if (addr.indexOf(']') !== -1)
parts = addr.split(/\]:?/);
else