diff --git a/lib/client.js b/lib/client.js index b299073..a239190 100644 --- a/lib/client.js +++ b/lib/client.js @@ -802,7 +802,7 @@ Client.prototype._newConnection = function() { log.trace('%s connect event', c.ldap.id); c.ldap.connected = true; - c.ldap.id += ':' + c.fd; + c.ldap.id += c.fd ? (':' + c.fd) : ''; c.emit('connect', true); }); c.setKeepAlive = function(enable, delay) { @@ -819,7 +819,7 @@ Client.prototype._newConnection = function() { // Wrap the events c.ldap = { - id: connectOpts.socketPath || self.url.hostname, + id: self.url ? self.url.hostname : connectOpts.socketPath, messageID: 0, messages: {} }; @@ -835,7 +835,7 @@ Client.prototype._newConnection = function() { log.trace('%s connect event', c.ldap.id); c.ldap.connected = true; - c.ldap.id += ':' + c.fd; + c.ldap.id += c.fd ? (':' + c.fd) : ''; self.emit('connect', c.ldap.id); });