| 108 | class MyEchoService : public ::test::EchoService { |
| 109 | public: |
| 110 | void Echo(::google::protobuf::RpcController* cntl_base, |
| 111 | const ::test::EchoRequest* req, |
| 112 | ::test::EchoResponse* res, |
| 113 | ::google::protobuf::Closure* done) { |
| 114 | brpc::ClosureGuard done_guard(done); |
| 115 | brpc::Controller* cntl = |
| 116 | static_cast<brpc::Controller*>(cntl_base); |
| 117 | const std::string* sleep_ms_str = |
| 118 | cntl->http_request().uri().GetQuery("sleep_ms"); |
| 119 | if (sleep_ms_str) { |
| 120 | bthread_usleep(strtol(sleep_ms_str->data(), NULL, 10) * 1000); |
| 121 | } |
| 122 | res->set_message(EXP_RESPONSE); |
| 123 | } |
| 124 | }; |
| 125 | |
| 126 | class HttpTest : public ::testing::Test{ |
no test coverage detected