This is an automated email from the ASF dual-hosted git repository. jamesge pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push: new 4e51908 Reset with_auth in controller before each sending 4e51908 is described below commit 4e519089a4f009c6892409a1a70d76fdb07eb5d5 Author: jamesge <jge...@gmail.com> AuthorDate: Mon Jan 20 14:29:24 2020 +0800 Reset with_auth in controller before each sending --- src/brpc/details/controller_private_accessor.h | 4 ++++ src/brpc/policy/redis_protocol.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/brpc/details/controller_private_accessor.h b/src/brpc/details/controller_private_accessor.h index 1aa567e..362c8f0 100644 --- a/src/brpc/details/controller_private_accessor.h +++ b/src/brpc/details/controller_private_accessor.h @@ -128,6 +128,10 @@ public: _cntl->add_flag(Controller::FLAGS_REQUEST_WITH_AUTH); } + void clear_with_auth() { + _cntl->clear_flag(Controller::FLAGS_REQUEST_WITH_AUTH); + } + std::string& protocol_param() { return _cntl->protocol_param(); } const std::string& protocol_param() const { return _cntl->protocol_param(); } diff --git a/src/brpc/policy/redis_protocol.cpp b/src/brpc/policy/redis_protocol.cpp index 1e92bf5..4756e66 100644 --- a/src/brpc/policy/redis_protocol.cpp +++ b/src/brpc/policy/redis_protocol.cpp @@ -329,6 +329,8 @@ void PackRedisRequest(butil::IOBuf* buf, } buf->append(auth_str); ControllerPrivateAccessor(cntl).add_with_auth(); + } else { + ControllerPrivateAccessor(cntl).clear_with_auth(); } buf->append(request); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org