chenBright commented on code in PR #2137:
URL: https://github.com/apache/brpc/pull/2137#discussion_r1131183178
##########
src/brpc/server.cpp:
##########
@@ -2191,6 +2197,21 @@ int Server::MaxConcurrencyOf(google::protobuf::Service*
service,
return MaxConcurrencyOf(service->GetDescriptor()->full_name(),
method_name);
}
+bool Server::AcceptRequest(Controller* cntl) const {
+ const Interceptor* interceptor = _options.interceptor;
+ int error_code = 0;
+ std::string error_text;
+ if (cntl && interceptor &&
+ !interceptor->Accept(cntl, error_code, error_text)) {
+ cntl->SetFailed(error_code,
Review Comment:
Maybe it would be more appropriate to let the user set the error code. Give
users more control, such as custom client retry logic.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]