From f0c864ca85092974249f0d1b87827abeb838c6e7 Mon Sep 17 00:00:00 2001 From: Martin Cizek Date: Thu, 17 Sep 2020 16:58:16 +0200 Subject: [PATCH] Revert redundant changes --- lib/client/client.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/client/client.js b/lib/client/client.js index 689f7f1..dffafe4 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -798,9 +798,9 @@ Client.prototype.connect = function connect () { self.url = self.urls[self._nextServer] if (self.url) { - self.host = url.hostname - self.port = url.port - self.secure = url.secure + self.host = self.url.hostname + self.port = self.url.port + self.secure = self.url.secure } cb = once(cb) @@ -831,13 +831,12 @@ Client.prototype.connect = function connect () { setupClient(cb) } - var port = (self.urls.length && self.urls[self._nextServer].port) || self.socketPath - var hostname = (self.urls.length && self.urls[self._nextServer].hostname) || undefined + var port = (self.port || self.socketPath) if (self.secure) { - socket = tls.connect(port, hostname, self.tlsOptions) + socket = tls.connect(port, self.host, self.tlsOptions) socket.once('secureConnect', onConnect) } else { - socket = net.connect(port, hostname) + socket = net.connect(port, self.host) socket.once('connect', onConnect) } socket.once('error', onResult)