通过hiredis适配器执行“脚本加载”命令时,出现时,我得到了错误的错误参数。通过Redis客户端的同一命令运行正常。

reply_r= (redisReply *)redisCommand(con_r,"script","load", "return 1");
      string stemp="";
      if(reply_r->len>0)
        {
          string stt(reply_r->str);
          stemp=stt;
          //printf("Commad Reply : %s\n", reply_r->str);

        }
      freeReplyObject(reply_r);//  should free the object after reading the data
      return stemp;

最佳答案

reply_r= (redisReply *)redisCommand(con_r,"scrips load %s", "return 1");
      string stemp="";
      if(reply_r->len>0 && reply_r!=NULL)
        {

          stemp=string(reply_r->str);

        }
      freeReplyObject(reply_r);//  should free the object after reading the data
      return stemp;

关于c++ - Redis命令ERR:参数数量不正确hiredis,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/63814984/

10-11 22:46