This repository was archived by the owner on May 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -798,9 +798,9 @@ Client.prototype.connect = function connect () {
798
798
self . url = self . urls [ self . _nextServer ]
799
799
800
800
if ( self . url ) {
801
- self . host = url . hostname
802
- self . port = url . port
803
- self . secure = url . secure
801
+ self . host = self . url . hostname
802
+ self . port = self . url . port
803
+ self . secure = self . url . secure
804
804
}
805
805
806
806
cb = once ( cb )
@@ -831,13 +831,12 @@ Client.prototype.connect = function connect () {
831
831
setupClient ( cb )
832
832
}
833
833
834
- var port = ( self . urls . length && self . urls [ self . _nextServer ] . port ) || self . socketPath
835
- var hostname = ( self . urls . length && self . urls [ self . _nextServer ] . hostname ) || undefined
834
+ var port = ( self . port || self . socketPath )
836
835
if ( self . secure ) {
837
- socket = tls . connect ( port , hostname , self . tlsOptions )
836
+ socket = tls . connect ( port , self . host , self . tlsOptions )
838
837
socket . once ( 'secureConnect' , onConnect )
839
838
} else {
840
- socket = net . connect ( port , hostname )
839
+ socket = net . connect ( port , self . host )
841
840
socket . once ( 'connect' , onConnect )
842
841
}
843
842
socket . once ( 'error' , onResult )
You can’t perform that action at this time.
0 commit comments