chenBright commented on code in PR #3535:
URL: https://github.com/apache/brpc/pull/3535#discussion_r4068934205
##########
test/brpc_rdma_unittest.cpp:
##########
@@ -169,139 +168,122 @@ static void ConnectToServer(butil::fd_guard* sockfd) {
}
class MyEchoService : public ::test::EchoService {
- void Echo(google::protobuf::RpcController* cntl_base,
- const ::test::EchoRequest* req,
- ::test::EchoResponse* res,
- google::protobuf::Closure* done) {
- Controller* cntl = static_cast<Controller*>(cntl_base);
- ClosureGuard done_guard(done);
- g_echo_served.fetch_add(1, butil::memory_order_relaxed);
- if (req->server_fail()) {
- cntl->SetFailed(req->server_fail(), "Server fail1");
- cntl->SetFailed(req->server_fail(), "Server fail2");
- return;
- }
- if (req->close_fd()) {
- usleep(1);
- LOG(INFO) << "close fd...";
- cntl->CloseConnection("Close connection according to request");
- return;
- }
- if (req->sleep_us() > 0) {
- LOG(INFO) << "sleep " << req->sleep_us() << "us...";
- bthread_usleep(req->sleep_us());
- }
- res->set_message("MyEchoService");
- if (req->code() != 0) {
- res->add_code_list(req->code());
- }
- cntl->response_attachment().append(cntl->request_attachment());
- }
+ void Echo(google::protobuf::RpcController *cntl_base,
Review Comment:
Do not change the code indentation from 4 to 2.
--
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]