@@ -25,7 +25,8 @@ RedisClient.prototype.batch = RedisClient.prototype.BATCH = function batch (args
2525// Store db in this.select_db to restore it on reconnect
2626RedisClient . prototype . select = RedisClient . prototype . SELECT = function select ( db , callback ) {
2727 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 ) {
2930 if ( err === null ) {
3031 self . selected_db = db ;
3132 }
@@ -36,7 +37,7 @@ RedisClient.prototype.select = RedisClient.prototype.SELECT = function select (d
3637RedisClient . prototype . monitor = RedisClient . prototype . MONITOR = function ( callback ) {
3738 // Use a individual command, as this is a special case that does not has to be checked for any other command
3839 var self = this ;
39- return this . send_command ( 'monitor' , [ ] , function ( err , res ) {
40+ return this . internal_send_command ( 'monitor' , [ ] , function ( err , res ) {
4041 if ( err === null ) {
4142 self . reply_parser . returnReply = function ( reply ) {
4243 // 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) {
8687 }
8788 utils . callback_or_emit ( self , callback , err , res ) ;
8889 } ;
89- var backpressure_indicator = this . send_command ( 'quit' , [ ] , callback_hook ) ;
90+ var backpressure_indicator = this . internal_send_command ( 'quit' , [ ] , callback_hook ) ;
9091 // Calling quit should always end the connection, no matter if there's a connection or not
9192 this . closing = true ;
9293 return backpressure_indicator ;
@@ -103,7 +104,7 @@ RedisClient.prototype.info = RedisClient.prototype.INFO = function info (section
103104 args = Array . isArray ( section ) ? section : [ section ] ;
104105 }
105106 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 ) {
107108 if ( res ) {
108109 var obj = { } ;
109110 var lines = res . toString ( ) . split ( '\r\n' ) ;
@@ -148,9 +149,10 @@ RedisClient.prototype.auth = RedisClient.prototype.AUTH = function auth (pass, c
148149 debug ( 'Sending auth to ' + self . address + ' id ' + self . connection_id ) ;
149150
150151 // Stash auth for connect and reconnect.
152+ pass = Array . isArray ( pass ) && pass . length === 1 ? pass [ 0 ] : pass ;
151153 this . auth_pass = pass ;
152154 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 ) {
154156 if ( err ) {
155157 if ( no_password_is_set . test ( err . message ) ) {
156158 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 () {
207209 arr [ i ] = arguments [ i ] ;
208210 }
209211 }
210- return this . send_command ( 'hmset' , arr , callback ) ;
212+ return this . internal_send_command ( 'hmset' , arr , callback ) ;
211213} ;
0 commit comments