pool: handle host+port collision between inbound and outbound.

This commit is contained in:
Christopher Jeffrey 2016-08-25 20:42:28 -07:00
parent 4fa6136ec4
commit 902fa59ca9
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -510,6 +510,14 @@ Pool.prototype._handleLeech = function _handleLeech(socket) {
return;
}
// Some kind of weird port collision
// between inbound ports and outbound ports.
if (this.peers.get(addr)) {
this.logger.debug('Port collision (%s).', hostname);
socket.destroy();
return;
}
this.addLeech(socket);
};