@@ -25,7 +25,8 @@ RedisClient.prototype.batch = RedisClient.prototype.BATCH = function batch (args
25
25
// Store db in this.select_db to restore it on reconnect
26
26
RedisClient . prototype . select = RedisClient . prototype . SELECT = function select ( db , callback ) {
27
27
var self = this ;
28
- return this . send_command ( 'select' , [ db ] , function ( err , res ) {
28
+ db = Array . isArray ( db ) && db . length === 1 ? db [ 0 ] : db ;
29
+ return this . internal_send_command ( 'select' , [ db ] , function ( err , res ) {
29
30
if ( err === null ) {
30
31
self . selected_db = db ;
31
32
}
@@ -36,7 +37,7 @@ RedisClient.prototype.select = RedisClient.prototype.SELECT = function select (d
36
37
RedisClient . prototype . monitor = RedisClient . prototype . MONITOR = function ( callback ) {
37
38
// Use a individual command, as this is a special case that does not has to be checked for any other command
38
39
var self = this ;
39
- return this . send_command ( 'monitor' , [ ] , function ( err , res ) {
40
+ return this . internal_send_command ( 'monitor' , [ ] , function ( err , res ) {
40
41
if ( err === null ) {
41
42
self . reply_parser . returnReply = function ( reply ) {
42
43
// If in monitor mode, all normal commands are still working and we only want to emit the streamlined commands
@@ -86,7 +87,7 @@ RedisClient.prototype.quit = RedisClient.prototype.QUIT = function (callback) {
86
87
}
87
88
utils . callback_or_emit ( self , callback , err , res ) ;
88
89
} ;
89
- var backpressure_indicator = this . send_command ( 'quit' , [ ] , callback_hook ) ;
90
+ var backpressure_indicator = this . internal_send_command ( 'quit' , [ ] , callback_hook ) ;
90
91
// Calling quit should always end the connection, no matter if there's a connection or not
91
92
this . closing = true ;
92
93
return backpressure_indicator ;
@@ -103,7 +104,7 @@ RedisClient.prototype.info = RedisClient.prototype.INFO = function info (section
103
104
args = Array . isArray ( section ) ? section : [ section ] ;
104
105
}
105
106
this . ready = ready || this . offline_queue . length === 0 ; // keep the execution order intakt
106
- var tmp = this . send_command ( 'info' , args , function ( err , res ) {
107
+ var tmp = this . internal_send_command ( 'info' , args , function ( err , res ) {
107
108
if ( res ) {
108
109
var obj = { } ;
109
110
var lines = res . toString ( ) . split ( '\r\n' ) ;
@@ -148,9 +149,10 @@ RedisClient.prototype.auth = RedisClient.prototype.AUTH = function auth (pass, c
148
149
debug ( 'Sending auth to ' + self . address + ' id ' + self . connection_id ) ;
149
150
150
151
// Stash auth for connect and reconnect.
152
+ pass = Array . isArray ( pass ) && pass . length === 1 ? pass [ 0 ] : pass ;
151
153
this . auth_pass = pass ;
152
154
this . ready = this . offline_queue . length === 0 ; // keep the execution order intakt
153
- var tmp = this . send_command ( 'auth' , [ pass ] , function ( err , res ) {
155
+ var tmp = this . internal_send_command ( 'auth' , [ pass ] , function ( err , res ) {
154
156
if ( err ) {
155
157
if ( no_password_is_set . test ( err . message ) ) {
156
158
self . warn ( 'Warning: Redis server does not require a password, but a password was supplied.' ) ;
@@ -207,5 +209,5 @@ RedisClient.prototype.hmset = RedisClient.prototype.HMSET = function hmset () {
207
209
arr [ i ] = arguments [ i ] ;
208
210
}
209
211
}
210
- return this . send_command ( 'hmset' , arr , callback ) ;
212
+ return this . internal_send_command ( 'hmset' , arr , callback ) ;
211
213
} ;
0 commit comments