From f3804bbca6a501649819d1b28e195c8d1a06d6a4 Mon Sep 17 00:00:00 2001 From: Martin Cizek Date: Fri, 18 Sep 2020 06:15:25 +0200 Subject: [PATCH] cr --- lib/client/client.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/client.js b/lib/client/client.js index 2862d76..2bb429c 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -115,8 +115,8 @@ function Client (options) { this._nextServer = Math.floor(Math.random() * this.urls.length) // updated in connectSocket() after each connect this.host = undefined - this.port = false - this.secure = false + this.port = undefined + this.secure = undefined this.url = undefined this.tlsOptions = options.tlsOptions this.socketPath = options.socketPath || false @@ -827,7 +827,7 @@ Client.prototype.connect = function connect () { var port = (server && server.port) || self.socketPath var host = server && server.hostname - if (self.secure) { + if (server && server.secure) { socket = tls.connect(port, host, self.tlsOptions) socket.once('secureConnect', onConnect) } else { @@ -996,7 +996,7 @@ Client.prototype.connect = function connect () { initialDelay: 1, maxDelay: 2 }) - failAfter = 1 + failAfter = this.urls.length || 1 } retry.failAfter(failAfter)