Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit f3804bb

Browse files
author
Martin Cizek
committed
cr
1 parent d32a765 commit f3804bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/client/client.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ function Client (options) {
115115
this._nextServer = Math.floor(Math.random() * this.urls.length)
116116
// updated in connectSocket() after each connect
117117
this.host = undefined
118-
this.port = false
119-
this.secure = false
118+
this.port = undefined
119+
this.secure = undefined
120120
this.url = undefined
121121
this.tlsOptions = options.tlsOptions
122122
this.socketPath = options.socketPath || false
@@ -827,7 +827,7 @@ Client.prototype.connect = function connect () {
827827

828828
var port = (server && server.port) || self.socketPath
829829
var host = server && server.hostname
830-
if (self.secure) {
830+
if (server && server.secure) {
831831
socket = tls.connect(port, host, self.tlsOptions)
832832
socket.once('secureConnect', onConnect)
833833
} else {
@@ -996,7 +996,7 @@ Client.prototype.connect = function connect () {
996996
initialDelay: 1,
997997
maxDelay: 2
998998
})
999-
failAfter = 1
999+
failAfter = this.urls.length || 1
10001000
}
10011001
retry.failAfter(failAfter)
10021002

0 commit comments

Comments
 (0)