lib/command/server/client.js
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var sub = info.command.sub
    , cmd = ('' + sub.cmd)
    , args = sub.args
    , timeout
    , conn;

  if(cmd === Constants.SUBCOMMAND.client.pause.name) {
    timeout = parseInt('' + args[0]);
    // redis returns: 'timeout is' ...
    // but we are not creating another error just yet!
    if(isNaN(timeout)) {
      throw IntegerRange;
    }
    args[0] = timeout;
  }else if(cmd === Constants.SUBCOMMAND.client.kill.name) {
    // kill by ip:port
    if(args.length === 1) {
      conn = this.state.getByAddr('' + args[0]);
      if(!conn) {
        throw NoSuchClient;
      }
      //console.dir('found kill connection');
      args[0] = conn;
    }
  }else if(cmd === Constants.SUBCOMMAND.client.setname.name) {
    // redis appears to allow every thing but whitespace
    if(/\s+/.test(args[0])) {
      throw ClientName;
    }
  }
}
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var sub = info.command.sub
    , cmd = ('' + sub.cmd)
    , args = sub.args
    , timeout
    , conn;

  if(cmd === Constants.SUBCOMMAND.client.pause.name) {
    timeout = parseInt('' + args[0]);
    // redis returns: 'timeout is' ...
    // but we are not creating another error just yet!
    if(isNaN(timeout)) {
      throw IntegerRange;
    }
    args[0] = timeout;
  }else if(cmd === Constants.SUBCOMMAND.client.kill.name) {
    // kill by ip:port
    if(args.length === 1) {
      conn = this.state.getByAddr('' + args[0]);
      if(!conn) {
        throw NoSuchClient;
      }
      //console.dir('found kill connection');
      args[0] = conn;
    }
  }else if(cmd === Constants.SUBCOMMAND.client.setname.name) {
    // redis appears to allow every thing but whitespace
    if(/\s+/.test(args[0])) {
      throw ClientName;
    }
  }
}
function validate ( cmd , args , info ) { AbstractCommand . prototype . validate . apply ( this , arguments ) ; var sub = info . command . sub , cmd = ( '' + sub . cmd ) , args = sub . args , timeout , conn ; if ( cmd === Constants . SUBCOMMAND . client . pause . name ) { timeout = parseInt ( '' + args [ 0 ] ) ; // redis returns: 'timeout is' ... // but we are not creating another error just yet! if ( isNaN ( timeout ) ) { throw IntegerRange ; } args [ 0 ] = timeout ; } else if ( cmd === Constants . SUBCOMMAND . client . kill . name ) { // kill by ip:port if ( args . length === 1 ) { conn = this . state . getByAddr ( '' + args [ 0 ] ) ; if ( ! conn ) { throw NoSuchClient ; } //console.dir('found kill connection'); args [ 0 ] = conn ; } } else if ( cmd === Constants . SUBCOMMAND . client . setname . name ) { // redis appears to allow every thing but whitespace if ( / \s+ / . test ( args [ 0 ] ) ) { throw ClientName ; } } }
Validate the CLIENT subcommands.
Validate the CLIENT subcommands .