You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/05/30 09:08:46 UTC

[GitHub] [incubator-brpc] liumh8 commented on a change in pull request #1128: fix redis args

liumh8 commented on a change in pull request #1128:
URL: https://github.com/apache/incubator-brpc/pull/1128#discussion_r432825252



##########
File path: example/redis_c++/redis_server.cpp
##########
@@ -64,9 +64,13 @@ class GetCommandHandler : public brpc::RedisCommandHandler {
     explicit GetCommandHandler(RedisServiceImpl* rsimpl)
         : _rsimpl(rsimpl) {}
 
-    brpc::RedisCommandHandlerResult Run(const std::vector<const char*>& args,
-                                          brpc::RedisReply* output,
-                                          bool /*flush_batched*/) override {
+    brpc::RedisCommandHandlerResult Run(const std::vector<butil::StringPiece>& args_piece,
+                                        brpc::RedisReply* output,
+                                        bool flush_batched) override {
+        std::vector<std::string> args;
+        for (size_t i = 0; i < args_piece.size(); ++i) {
+            args.emplace_back(args_piece[i].data(), args_piece.size());
+        }

Review comment:
       这个是为了方便,不修改后面的逻辑。




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org