diff --git a/src/brpc/redis.cpp b/src/brpc/redis.cpp index 9af036f857..b9c5363f3e 100644 --- a/src/brpc/redis.cpp +++ b/src/brpc/redis.cpp @@ -101,10 +101,10 @@ bool RedisRequest::AddCommand(const butil::StringPiece& command) { CHECK(st.ok()) << st; _has_error = true; return false; - } + } } -bool RedisRequest::AddCommandByComponents(const butil::StringPiece* components, +bool RedisRequest::AddCommandByComponents(const butil::StringPiece* components, size_t n) { if (_has_error) { return false; @@ -117,7 +117,7 @@ bool RedisRequest::AddCommandByComponents(const butil::StringPiece* components, CHECK(st.ok()) << st; _has_error = true; return false; - } + } } bool RedisRequest::AddCommandWithArgs(const char* fmt, ...) { @@ -356,7 +356,7 @@ bool RedisService::AddCommandHandler(const std::string& name, RedisCommandHandle _command_map[lcname] = handler; return true; } - + RedisCommandHandler* RedisService::FindCommandHandler(const butil::StringPiece& name) const { auto it = _command_map.find(name.as_string()); if (it != _command_map.end()) { @@ -371,6 +371,11 @@ RedisCommandHandler* RedisCommandHandler::NewTransactionHandler() { } // ========== impl of RedisConnContext ========== +RedisConnContext::RedisConnContext(const RedisService* rs) + : redis_service(rs) + , batched_size(0) + , session(nullptr) {} + RedisConnContext::~RedisConnContext() { } void RedisConnContext::Destroy() { diff --git a/src/brpc/redis.h b/src/brpc/redis.h index 50064519f7..c140baf34b 100644 --- a/src/brpc/redis.h +++ b/src/brpc/redis.h @@ -217,10 +217,7 @@ class RedisCommandParser; // This class is as parsing_context in socket. class RedisConnContext : public Destroyable { public: - explicit RedisConnContext(const RedisService* rs) - : redis_service(rs) - , batched_size(0) - , session(nullptr) {} + explicit RedisConnContext(const RedisService* rs); ~RedisConnContext(); // @Destroyable